Hi,
You need to check the uploader instance is available before you use "startupload()". Try the example below
I just added the section below for your code.
if (uploadobj) {}
- <%@ Page Language="C#" AutoEventWireup="true" %>
-
- <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <title>Start uploading manually</title>
- <script type="text/javascript">
-
- function submitbutton_click() {
-
- var submitbutton = document.getElementById('<%=SubmitButton.ClientID %>');
-
- var fileInputs = ["<%=fileinput1.ClientID%>",
- "<%=fileinput2.ClientID%>",
- "<%=fileinput3.ClientID%>"];
-
- if (!window.filesuploaded) {
- for (var i = 0; i < 3; i++) {
-
- var uploadobj = document.getElementById(fileInputs[i]);
- if (uploadobj) {
- if (uploadobj.getqueuecount() > 0) {
- uploadobj.startupload();
- }
- }
-
- }
- return false;
- }
-
- window.filesuploaded = false;
- return true;
- }
-
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr valign="middle">
- <td class='standardText'>
- <asp:Label Visible="true" ID="label1" runat="server">First file for upload</asp:Label>
- </td>
- <td class='standardText'>
- <CuteWebUI:Uploader runat="server" ManualStartUpload="true" ID="fileinput1" InsertText="Browse Files1"
- MultipleFilesUpload="true" Visible="False">
- </CuteWebUI:Uploader>
- </td>
- </tr>
- <tr valign="middle">
- <td class='standardText'>
- <asp:Label Visible="true" ID="label2" runat="server">Second file for upload</asp:Label>
- </td>
- <td class='standardText'>
- <CuteWebUI:Uploader runat="server" ManualStartUpload="true" ID="fileinput2" InsertText="Browse Files2"
- MultipleFilesUpload="true" Visible="True">
- </CuteWebUI:Uploader>
- </td>
- </tr>
- <tr valign="middle">
- <td class='standardText'>
- <asp:Label Visible="true" ID="label3" runat="server">Last file for upload</asp:Label>
- </td>
- <td class='standardText'>
- <CuteWebUI:Uploader runat="server" ManualStartUpload="true" ID="fileinput3" InsertText="Browse Files3"
- MultipleFilesUpload="true" ValidateOption-MaxSizeKB="2097152" Visible="True">
- </CuteWebUI:Uploader>
- </td>
- </tr>
- <caption>
- <p>
- <asp:Button ID="SubmitButton" runat="server" Text="Submit" OnClientClick="return submitbutton_click()" />
- </p>
- </caption>
- </table>
- </form>
- </body>
- </html>
Regards,
Ken