Hi AlxReiter,
Please try the example below, it will work for both uploader controls.
- <%@ Page Language="C#" %>
-
- <%@ Register Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" TagPrefix="CuteWebUI" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <script runat="server">
-
-
- protected override void OnInit(EventArgs e)
- {
- base.OnInit(e);
- SubmitButton.Attributes["onclick"] = "return submitbutton_click()";
- }
-
- </script>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <title>Start uploading manually</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div class="content">
- <CuteWebUI:UploadAttachments runat="server" ManualStartUpload="true" ID="Uploader1"
- InsertText="Browse Files1 (Max 1M)">
- </CuteWebUI:UploadAttachments>
- <br />
- <CuteWebUI:UploadAttachments runat="server" ManualStartUpload="true" ID="Uploader2"
- InsertText="Browse Files2 (Max 1M)">
- </CuteWebUI:UploadAttachments>
- <p>
- <asp:Button runat="server" ID="SubmitButton" Text="Submit" />
- </p>
- <script type="text/javascript">
-
- function submitbutton_click() {
- var submitbutton = document.getElementById('<%=SubmitButton.ClientID %>');
- var uploadobj = document.getElementById('<%=Uploader1.ClientID %>');
- var uploadobj2 = document.getElementById('<%=Uploader2.ClientID %>');
- if (!window.filesuploaded) {
- if (uploadobj.getqueuecount() > 0 && uploadobj2.getqueuecount() > 0) {
-
- uploadobj.startupload();
- uploadobj2.startupload();
- }
- return false;
- }
- window.filesuploaded = false;
- return true;
- }
- function CuteWebUI_AjaxUploader_OnPostback() {
- window.filesuploaded = true;
- var submitbutton = document.getElementById('<%=SubmitButton.ClientID %>');
- submitbutton.click();
- return false;
- }
- </script>
- </div>
- </form>
- </body>
- </html>
Regards,
Ken