custom upload button

Last post 07-18-2010, 11:22 PM by cutechat. 4 replies.
Sort Posts: Previous Next
  •  06-18-2010, 7:41 AM 61863

    custom upload button

    Hi,
     
    I want to create a custom upload button.
    I can create a custom button to select the files but this isn't what I want.
     
    I have a button which has to do serveral other tasks and also upload the selected files.
    But I can't figure out how to call the upload function from an other butten.
    Is this possible?
     
    Regs
     
    Bart
  •  06-18-2010, 10:43 AM 61868 in reply to 61863

    Re: custom upload button

  •  07-03-2010, 3:16 AM 62270 in reply to 61863

    Re: custom upload button

    Bart,
     
    We provide a uploader.browse() function, but it will show dialog be blocked, for the Flash/Silverlight.
     
    So we put a transparent layer to the button for that case.
     
    You can try this way :
     

    <CuteWebUI:Uploader ID="Uploader1" runat="server" InsertButtonID="MyButton">
    </CuteWebUI:Uploader>
    <asp:Button ID="MyButton" runat="server" Text="My Button" />
    <input type=checkbox id='checkbox1' name="checkbox1" />Check It Before Browse File
    <script>
    function CuteWebUI_AjaxUploader_OnBrowse()
    {
     //this is the example code, after the button be clicked, this function will be called

     if(!document.getElementById("checkbox1").checked)
     {
      alert("Please check the checkbox");
      //you can cancel the dialog
      return false;
     } 
    }
    </script>

     
    Regards,
    Terry
  •  07-05-2010, 7:02 AM 62288 in reply to 62270

    Re: custom upload button

    I created my own button and append this javascript on the onclick function
     
    btnAddFiles.Attributes.add("OnClick","document.getElementById('" & Myform.clientId & "_fileUploader').startupload();return false;")
  •  07-18-2010, 11:22 PM 62554 in reply to 62288

    Re: custom upload button

    Hi,
     
    Because the Flash/Silverlight limited ,
     
    So Uploader only support this logic :
     
    1 - user click the button (actually click on the Flash/Siverlight transparent layer, not on the button)
     
    2 - uploader fire the CuteWebUI_AjaxUploader_OnBrowse event.
      you can put your login in that function , decide show the dialog or cancel it.
     
    There's no other way to do more.  Setteing the onclick event on the button also have no effect.
     
    Regards,
    Terry
     
View as RSS news feed in XML