locked
AjaxFileUpload and Wait Message RRS feed

  • Question

  • User1582784766 posted

    I've got the AjaxFileUpload control working fine.

    When the OnUploadComplete server side event is called, I'd like to be display a "wait" message while the user is waiting.

    protected void OnUploadComplete(object sender, AjaxFileUploadEventArgs e) 
    { 
       try 
       { 
          // does something very long 
       } 
       catch (Exception ex) 
       { 
       } 
    }

    How can I do this ?

    Wednesday, October 30, 2013 6:27 AM

Answers

  • User-933407369 posted

    hi  cabbry,

    it is not possible to wait the end of the upload to display the message. Because the onProgressHandler event is  loaded  When the page loading.

    you click here to see the sourcecode.But  you can use onClientUploadComplete and onClientUploadCompleteAll  property to add your own displaying  messages.

    Please go to  ASP.NET AJAX Control Toolkit to download the complete project and see AjaxFileUpload control usage.

    • OnClientUploadComplete - The name of a JavaScript function executed on the client-side after a file is uploaded successfully.  
    • OnClientUploadCompleteAll - The name of a JavaScript function executed on the client-side after all files are uploaded.           
    • OnClientUploadStart - The name of a JavaScript function executed on the  client-side before any files are uploaded.   
    • OnClientUploadError - The name of a JavaScript function executed on the client-side if the file upload failed.       

    you also can see the sourcecodes of the AjaxFileUpload libs and download or change it:

    http://ajaxcontroltoolkit.codeplex.com/sourcecontrol/latest#Server/AjaxControlToolkit/AjaxFileUpload/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 31, 2013 10:25 PM

All replies

  • User555306248 posted

    Check out this blog post:

    http://mattberseth.com/blog/2008/07/aspnet_file_upload_with_realti_1.html

    It also has links to file upload components that notify the user of progress uploading the file.

    Thursday, October 31, 2013 12:32 AM
  • User-933407369 posted

    hi cabbry ,

    May 2012 release of AjaxControlToolkit includes a new AjaxFileUpload Control which supports Multiple File Upload, Progress Bar and Drag And Drop functionality.
    These new features are supported by Google Chrome version 16+, Firefox 8+ , Safari 5+ and Internet explorer 10 + , IE9 or earlier does not support this feature.

    I sugeest you try to set ThrobberID property .

    ThrobberID is used to display loading image instead of progress bar in unsupported browsers.

    Please read the reference below for more information:

    Asp.Net AjaxFileUpload Control With Drag Drop And Progress Bar

    http://csharpdotnetfreak.blogspot.com/2012/08/aspnet-ajaxfileupload-control-dragdrop-progress-bar.html

     Hope it helps you.

    Thursday, October 31, 2013 12:51 AM
  • User1582784766 posted

    I am already using AjaxFileUpload Control of AjaxControlToolkit and the progress bar is ok.

    But is it possible to wait the end of the upload to display the message (when it shows 100%) ?

    Because my treatment in OnUploadComplete event is very long.

    Thursday, October 31, 2013 9:38 AM
  • User-933407369 posted

    hi  cabbry,

    it is not possible to wait the end of the upload to display the message. Because the onProgressHandler event is  loaded  When the page loading.

    you click here to see the sourcecode.But  you can use onClientUploadComplete and onClientUploadCompleteAll  property to add your own displaying  messages.

    Please go to  ASP.NET AJAX Control Toolkit to download the complete project and see AjaxFileUpload control usage.

    • OnClientUploadComplete - The name of a JavaScript function executed on the client-side after a file is uploaded successfully.  
    • OnClientUploadCompleteAll - The name of a JavaScript function executed on the client-side after all files are uploaded.           
    • OnClientUploadStart - The name of a JavaScript function executed on the  client-side before any files are uploaded.   
    • OnClientUploadError - The name of a JavaScript function executed on the client-side if the file upload failed.       

    you also can see the sourcecodes of the AjaxFileUpload libs and download or change it:

    http://ajaxcontroltoolkit.codeplex.com/sourcecontrol/latest#Server/AjaxControlToolkit/AjaxFileUpload/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 31, 2013 10:25 PM