I have a AjaxFileUpload control, that for some reason stopped triggering the OnUploadComplete. Here is what I have;
<asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" Width="500px" OnUploadComplete="File_Upload"
MaximumNumberOfFiles="20" />
code behind;
Protected Sub File_Upload(ByVal sender As Object, ByVal e As AjaxFileUploadEventArgs)
Dim filename = "Some_File"
Dim strDestPath As String = MapPath("~/Documents/")
Dim filetype As String = Path.GetExtension(e.FileName)
Dim Count As Integer = 0
Dim root As New DirectoryInfo(strDestPath)
Dim listfiles As FileInfo() = root.GetFiles(filename + "-*.*")
If listfiles.Length > 0 Then
Count = listfiles.Length + 1
Try
AjaxFileUpload1.SaveAs(strDestPath + filename + "-" + Convert.ToString(Count) + filetype)
Catch ex As Exception
End Try
Else
Count = 1
Try
AjaxFileUpload1.SaveAs(strDestPath + filename + "-" + Convert.ToString(Count) + filetype)
Catch ex As Exception
End Try
End If
End Sub
Web.config;
<handlers>
<add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/>
</handlers>
Master Form;
<form id="form1" runat="server" method="post" enctype="multipart/form-data">
It worked at one time, once. And it works on a test form I made, but for some reason I am not getting it to fire on this project. What am I missing here?