Hello,
I have one AsyncFileUpload Control on the page. with below code snippet.
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><html><head><script type="text/javascript">
function uploadError(sender, args) {
$get("<%=lblMesg.ClientID%>").style.color = "red";
//$get("<%=lblMesg.ClientID%>").innerHTML = "File upload failed. Please check file format or size.";
$get("<%=lblMesg.ClientID%>").innerHTML = args._errorMessage.toString();
}
function closewindow() {
// Code to cleare the control
var who = document.getElementById('<%= AsyncFileUpload1.UniqueID %>')[0];
who.value = "";
var who2 = who.cloneNode(false);
who2.onchange = who.onchange;
who.parentNode.replaceChild(who2, who);
// end clear code
$get("<%=lblMesg.ClientID%>").style.color = "green";
$get("<%=lblMesg.ClientID%>").innerHTML = "File Uploaded Successfully";
window.opener.location.href = "/MamberManagement/NominationVerifiedList/";
//window.opener.location.reload(true);
window.close();
}</script></head><body><form id="form1" runat="server" enctype="multipart/form-data" method="post"><div id="Upload" align="center"><cc1:ToolkitScriptManager ID="ToolkitScriptManager" runat="server"></cc1:ToolkitScriptManager><table><tr><td class="style5"><label> </label></td><td align="left"><cc1:AsyncFileUpload OnClientUploadError="uploadError" runat="server" ID="AsyncFileUpload1"
Width="242px" CompleteBackColor="White" OnClientUploadComplete="closewindow"
UploadingBackColor="#CCFFFF" ThrobberID="imgLoader" OnUploadedComplete="FileUploadComplete"
UploaderStyle="Modern" /> <asp:Image ID="imgLoader" runat="server" ImageUrl="~/Images/ColumnProgress.gif" Style="margin-bottom: 0px" /></td></tr></table></form></body></html>It does work for the first time. But when I upload second time in the same session, it doesn't fire any event.
Anyone can help me on this?