Re: Multiple fileupload in usercontrol. When submitting, AttachmentItemCollection does not have any items (count = 0)

  •  02-27-2014, 8:07 AM

    Re: Multiple fileupload in usercontrol. When submitting, AttachmentItemCollection does not have any items (count = 0)

    Hi nygter,

     

    Below is the javascript part of the start upload manually example, it use to start the upload when click on the button.  If you do not use the js code to start the upload, then when click on the button, it will not does anything.

     

    1. <script type="text/javascript">  
    2.            function submitbutton_click() {  
    3.                var submitbutton = document.getElementById('<%=SubmitButton.ClientID %>');  
    4.                var uploadobj = document.getElementById('<%=Uploader1.ClientID %>');  
    5.                if (uploadobj.getqueuecount() == 0) {  
    6.                    submitbutton.click();  
    7.                } else {  
    8.                    if (!window.filesuploaded) {  
    9.                        if (uploadobj.getqueuecount() > 0) {  
    10.                            uploadobj.startupload();  
    11.                        }  
    12.                        return false;  
    13.                    }  
    14.                }  
    15.                window.filesuploaded = false;  
    16.                return true;  
    17.            }  
    18.            function CuteWebUI_AjaxUploader_OnPostback() {  
    19.                window.filesuploaded = true;  
    20.                var submitbutton = document.getElementById('<%=SubmitButton.ClientID %>');  
    21.       submitbutton.click();  
    22.       return false;  
    23.   }  
    24.        </script>  
     

    Regards,

     

    Ken 

View Complete Thread