Re: How to trigger browseclick() manually?

  •  08-28-2012, 8:38 AM

    Re: How to trigger browseclick() manually?

    Hi vso,

     

    If you want to open the upload file dialog by code, for security reason, for now can not achieve it. The select file dialog must open by the end user click manually.

     

    If you want to catch the onclick event at client side, then please try the example code below.

     

    1. <%@ Page Language="C#" %>  
    2.   
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    4. <html xmlns="http://www.w3.org/1999/xhtml">  
    5. <head id="Head1" runat="server">  
    6.     <title>example</title>  
    7. </head>  
    8. <body>  
    9.     <form id="form1" runat="server">  
    10.         <CuteWebUI:Uploader ID="Uploader1" runat="server">  
    11.         </CuteWebUI:Uploader>  
    12.     </form>  
    13. </body>  
    14. </html>  
    15.   
    16. <script type="text/javascript">  
    17. var uploader1=document.getElementById('<%=Uploader1.ClientID%>')  
    18. uploader1.handlebrowse=function()  
    19. {  
    20.     alert("click!");    
    21. }  
    22. </script>  
    Regards,

     

    Ken 

View Complete Thread