"Wait to finish upload" message if some one do another activity during upload is in progress

Last post 03-12-2013, 12:05 PM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  03-12-2013, 9:15 AM 77023

    "Wait to finish upload" message if some one do another activity during upload is in progress

    I need to display a meesage to user if he do any action on page if upload is in progress.

    i mean user selects file to upload and upload starts and before completion , user click on another button on page, here message should be

    prompted like "wait upload is in progress." 

     

    Thanks

    Rajiv 

    Filed under:
  •  03-12-2013, 12:05 PM 77026 in reply to 77023

    Re: "Wait to finish upload" message if some one do another activity during upload is in progress

    Hi krajiv23,

     

    The uploader has not the property to check the states, so you can add a  variable to check it between the upload progress, like the example below.

     

    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>  
    4. <!DOCTYPE html>  
    5.   
    6. <html xmlns="http://www.w3.org/1999/xhtml">  
    7. <head runat="server">  
    8.     <title>example</title>  
    9. </head>  
    10. <body>  
    11.     <form id="form1" runat="server">  
    12.         <div>  
    13.             <CuteWebUI:Uploader runat="server" ID="uploader1" >  
    14.             </CuteWebUI:Uploader>  
    15.             <asp:Button ID="btnPostBack" runat="server" Text="post back" OnClientClick="return postback()" />  
    16.         </div>  
    17.     </form>  
    18. </body>  
    19. </html>  
    20.   
    21. <script type="text/javascript">  
    22.     var finish=null;  
    23.     function CuteWebUI_AjaxUploader_OnStart()  
    24.     {  
    25.         finish=false;  
    26.     }  
    27.     function CuteWebUI_AjaxUploader_OnTaskComplete(task)  
    28.     {  
    29.         finish=true;  
    30.     }  
    31.     function postback()  
    32.     {  
    33.         if(finish==false)  
    34.         {  
    35.             alert("wait upload is in progress.");  
    36.             return false;  
    37.         }  
    38.     }  
    39. </script>  
     

    Regards,

     

    Ken 

View as RSS news feed in XML