Hi skruis,
Please try the example below
- <%@ Page Language="VB" %>
-
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <script runat="server">
- Private uploadcount As Integer = 0
- Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
- SubmitButton.Attributes("itemcount") = Uploader1.Items.Count.ToString()
-
- MyBase.OnPreRender(e)
- End Sub
-
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>Untitled Page</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <CuteWebUI:UploadAttachments runat="server" ManualStartUpload="true" ID="Uploader1"
- InsertText="Browse Files ">
- </CuteWebUI:UploadAttachments>
- <br />
- <br />
- <asp:Button runat="server" ID="SubmitButton" OnClientClick="return submitbutton_click()"
- Text="Submit" /><br />
- <br />
- <input type="button" value="get count" onclick="getCount()" />
- </form>
- </body>
- </html>
-
- <script type="text/javascript">
- function getCount()
- {
- var uploadobj=document.getElementById(
- alert(uploadobj.getqueuecount());
- }
- function submitbutton_click()
- {
- var submitbutton=document.getElementById(
- var uploadobj=document.getElementById(
- if(!window.filesuploaded)
- {
- if(uploadobj.getqueuecount()>0)
- {
- uploadobj.startupload();
- }
- else
- {
- var uploadedcount=parseInt(submitbutton.getAttribute("itemcount"))||0;
- if(uploadedcount>0)
- {
- return true;
- }
- alert("Please browse files for upload");
- }
- return false;
- }
- window.filesuploaded=false;
- return true;
- }
- function CuteWebUI_AjaxUploader_OnPostback()
- {
- window.filesuploaded=true;
- var submitbutton=document.getElementById(
- submitbutton.click();
- return false;
- }
- </script>
Regards,
ken