Does not redirect page after UploadComplete in AsyncFileUpload c# RRS feed

  • Question

  • User-2050663300 posted

    I am using Ajax AsyncFileUpload in asp.net. It is working fine in uploading image but don't know why it is redirecting to same page with some querystring OnUploadComplete. I don't want to reload page. How to solve this ?

    My Code is as below:

    function uploadComplete() {
        document.getElementById('<%=lblPhotoUpload.ClientID %>').innerHTML = "Quiz Image Uploaded Successfully.";
    function uploadError() {
         document.getElementById('<%=lblPhotoUpload.ClientID %>').innerHTML = "File Upload Failed.";
    function uploadQuizImageStart() {
    <asp:AsyncFileUpload ID="fuPhoto" runat="server" UploadingBackColor="#779ED3" CompleteBackColor="#179406" ThrobberID="imgLoad" OnUploadedComplete="QuizImageUploadComplete" OnClientUploadStarted="uploadQuizImageStart" OnClientUploadComplete="uploadComplete" OnClientUploadError="uploadError" UploaderStyle="Traditional" />
    <span id="UploadQuizImageProcess" style="display: none">
    <img src="../images/uploading.gif" alt="Upload" /></span>
    <asp:Label ID="lblPhotoUpload" runat="server" CssClass="lbler"></asp:Label>
    protected void QuizImageUploadComplete(object sender, AsyncFileUploadEventArgs e)
            if (fuPhoto.HasFile)
                string filename = "";
                filename = "quiz" + ".jpg";
                // Save Image
    Monday, May 25, 2015 12:11 AM