Ajax Uploader Start-uploading-manually and validate page controls with out using javascript

Last post 03-07-2012, 7:36 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  03-06-2012, 9:14 AM 73350

    Ajax Uploader Start-uploading-manually and validate page controls with out using javascript

    hi..
     
    i am planning to buy the ajax uploader for asp.net.
     
    i want to start uploading the file using the asp.net button control using the ajax uploader.(manual option)
     
    is it possible? i set the property   ManualStartUpload="true" and i used the asp.net button control.
    here in my page i have used the required field validator to validate controls with out using javascript. but its not working for me.
    i am not validate my page controls.
     
    how to handle this..
     
    need ur suggestions  ..
     
     
    regards
    gopal.s 
     
     
     
     
     
    Filed under: ,
  •  03-07-2012, 7:36 AM 73367 in reply to 73350

    Re: Ajax Uploader Start-uploading-manually and validate page controls with out using javascript

    Hi gopalnivas,
     
    Below is the manual start upload example
     
    <%@ Page Language="C#" %>
    <%@ 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">
    <script runat="server">   
     
    </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">
            <CuteWebUI:Uploader runat="server" ManualStartUpload="true" ID="Uploader1" InsertText="Browse Files (Max 1M)">
            </CuteWebUI:Uploader>
            <br />
            <br />
            <asp:Button runat="server" ID="SubmitButton" OnClientClick="return submitbutton_click()"
                Text="Submit" /><br />
            <script type="text/javascript">
    function submitbutton_click()
    {
    var submitbutton=document.getElementById('<%=SubmitButton.ClientID %>');
    var uploadobj=document.getElementById('<%=Uploader1.ClientID %>');
    if(!window.filesuploaded)
    {
    if(uploadobj.getqueuecount()>0)
    {
    uploadobj.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>
        </form>
    </body>
    </html>
     
    Regards,
     
    Ken 
View as RSS news feed in XML