Re: Manual upload with visible="false"

  •  11-13-2012, 2:44 AM

    Re: Manual upload with visible="false"

    1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="_myStartUploadingManually.aspx.cs" Inherits="AJAXUploader_new_version_basic_samples._myStartUploadingManually" %> 
    2. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %> 
    3.  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    5.  
    6. <html xmlns="http://www.w3.org/1999/xhtml"> 
    7. <head id="Head1" runat="server"> 
    8.     <title>Start uploading manually</title> 
    9.     <link rel="stylesheet" href="demo.css" type="text/css" /> 
    10.     <script type="text/javascript" src="jquery-1.8.2.min.js"></script> 
    11.     <script type="text/javascript"> 
    12.  
    13.         function CuteWebUI_AjaxUploader_OnSelect(files) { 
    14.             for (var i = 0; i < files.length; i++) { 
    15.                 if (files[i].FileSize > 2097152) 
    16.                     alert("File to large!"); 
    17.                 files[i].Cancel(); 
    18.              } 
    19.          } 
    20.  
    21.         function submitbutton_click() { 
    22.  
    23.             var submitbutton = document.getElementById('<%=SubmitButton.ClientID %>'); 
    24.  
    25.             var fileInputs = ["<%=fileinput1.ClientID%>", "<%=fileinput2.ClientID%>", "<%=fileinput3.ClientID%>"]; 
    26.  
    27.             if (!window.filesuploaded) { 
    28.                 for(var i=0; i<3; i++) { 
    29.  
    30.                     var uploadobj = document.getElementById(fileInputs[i]); 
    31.                     if (uploadobj.getqueuecount() > 0) { 
    32.                         uploadobj.startupload(); 
    33.                     } 
    34.                 } 
    35.                 return false; 
    36.             } 
    37.              
    38.             window.filesuploaded = false
    39.             return true; 
    40.         } 
    41.          
    42.         </script>   
    43. </head> 
    44. <body> 
    45.     <form id="form1" runat="server"> 
    46.         <asp:ScriptManager ID="Scriptmanager1" runat="server"></asp:ScriptManager> 
    47.             <asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
    48.                 <ContentTemplate> 
    49.                     <table border="0" cellpadding="0" cellspacing="0" width="100%"> 
    50.                          
    51.                         <tr valign="middle"> 
    52.                             <td class='standardText'><asp:Label Visible="false" ID="label1" runat="server">First file for upload</asp:Label></td> 
    53.                             <td class='standardText'><CuteWebUI:Uploader runat="server"  
    54.                                     ManualStartUpload="true" ID="fileinput1" 
    55.                                 InsertText="Browse Files1" onfileuploaded="fileinput_FileUploaded"   
    56.                                     MultipleFilesUpload="false" ValidateOption-MaxSizeKB="2097152"></CuteWebUI:Uploader></td> 
    57.                         </tr> 
    58.                          
    59.                         <tr valign="middle"> 
    60.                             <td class='standardText'><asp:Label Visible="true" ID="label2" runat="server">Second file for upload</asp:Label></td> 
    61.                             <td class='standardText'><CuteWebUI:Uploader runat="server" ManualStartUpload="true" ID="fileinput2"   
    62.                                 InsertText="Browse Files2" onfileuploaded="fileinput_FileUploaded" MultipleFilesUpload="false" ValidateOption-MaxSizeKB="2097152"></CuteWebUI:Uploader></td> 
    63.                         </tr> 
    64.                          
    65.                         <tr valign="middle"> 
    66.                             <td class='standardText'><asp:Label Visible="true" ID="label3" runat="server">Last file for upload</asp:Label></td> 
    67.                             <td class='standardText'><CuteWebUI:Uploader runat="server" ManualStartUpload="true" ID="fileinput3"   
    68.                                 InsertText="Browse Files3" onfileuploaded="fileinput_FileUploaded" MultipleFilesUpload="false" ValidateOption-MaxSizeKB="2097152"></CuteWebUI:Uploader></td> 
    69.                         </tr> 
    70.                          
    71.                         <caption> 
    72.                             <p> 
    73.                                 <asp:Button ID="SubmitButton" runat="server" Text="Submit"  
    74.                                     OnClientClick="return submitbutton_click()" /> 
    75.                             </p> 
    76.                         </caption> 
    77.                     </table> 
    78.                 </ContentTemplate> 
    79.         </asp:UpdatePanel> 
    80.     </form> 
    81. </body> 
    82. </html> 
View Complete Thread