Re: CopyTo casuing 'Loading...' text to stay on screen

  •  07-30-2009, 2:35 AM

    Re: CopyTo casuing 'Loading...' text to stay on screen

    Please check this sample code :
     
     
    1. <%@ Page Language="C#" Title="Total Progress" %>  
    2. <%@ Import Namespace="CuteWebUI" %>  
    3. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">  
    5.   
    6. <script runat="server">  
    7.   
    8.     void InsertMsg(string msg)   
    9.     {   
    10.         ListBoxEvents.Items.Insert(0, msg);   
    11.         ListBoxEvents.SelectedIndex = 0;   
    12.     }   
    13.     protected void UploadAttachments1_AttachmentAdded(object sender, AttachmentItemEventArgs args)   
    14.     {   
    15.         InsertMsg("Added.." + args.Item.FileName);   
    16.     }   
    17.   
    18. </script>  
    19.   
    20. <html xmlns="http://www.w3.org/1999/xhtml">  
    21. <head id="Head1" runat="server">  
    22. </head>  
    23. <body>  
    24.     <form id="Form1" runat="server">  
    25.         <CuteWebUI:UploadAttachments runat="server" ID="UploadAttachments1" OnAttachmentAdded="UploadAttachments1_AttachmentAdded">  
    26.         </CuteWebUI:UploadAttachments>  
    27.         <div id='progressInfo' style="display:none;font-size:18px;color:DarkRed"></div>  
    28.         <br />  
    29.         <div>  
    30.             Server Trace:   
    31.             <br />  
    32.             <asp:ListBox runat="server" ID="ListBoxEvents" Width="800"></asp:ListBox>  
    33.         </div>  
    34.     </form>  
    35.     <script type="text/javascript">  
    36.     var uploader=document.getElementById('<%=UploadAttachments1.ClientID %>');   
    37.     function CuteWebUI_AjaxUploader_OnQueueUI(list)   
    38.     {   
    39.         if(list.length<2)return;   
    40.            
    41.         var errorcount=0;   
    42.         for(var i=0;i<list.length;i++)   
    43.         {   
    44.             var size=list[ i ].FileSize;    //or -1 if iframe mode   
    45.             var stat=list[ i ].Status;   
    46.                
    47.             if(stat=="Cancel"||stat=="Error")   
    48.                 errorcount++;   
    49.         }   
    50.         if(errorcount==list.length)   
    51.         {   
    52.             setTimeout(uploader.reset,1);   
    53.         }   
    54.     }   
    55.     </script>  
    56.   
    57. </body>  
    58. </html>  

     
    Regards,
    Terry
     
View Complete Thread