Search code examples
c#asp.netajaxeventsasyncfileupload

ASP.Net Ajax AsyncFileUpload events not firing after postback - ASP.NET, C#


I have ASP.Net Ajax AsyncFileUpload in one of my pages. All the events including OnUploadedComplete, are firing fine after page load and after page is posted back using a button or something those events are not firing.

This is my form tag

<form id="form1" runat="server" enctype="multipart/form-data">

This is my AsyncFileUpload tag

<ajaxToolkit:AsyncFileUpload runat="server" ID="FileUpload" ClientIDMode="Static" OnClientUploadStarted="onClientUploadStarted" OnClientUploadComplete="onClientUploadCompleted" OnClientUploadError="onClientUploadError"
                            Width="100%" UploaderStyle="Traditional" OnUploadedComplete="ProcessUpload" UploadingBackColor="#FFFFFF"
                            ErrorBackColor="White" CompleteBackColor="White" CssClass="upload" Style="display: none" />

and I have used a master page in my project.This is weird and any help would be greatly appreciated.

Edited

In the browser console there is an error saying,

Uncaught ReferenceError: partialLoad is not defined


Solution

  • Finally, I found the reason why it didn't work. I have called none existing javascript function (Using ScriptManager) in the button click event and that's why console showed that Uncaught ReferenceError: partialLoad is not defined error. Once I removed that function call, AsyncFileUpload events worked Fine.

    Thanks for the quick response king.code and Ronaldinho Learn Coding

    cheers (Y)