Re: Cancel the browse dialogue

  •  09-28-2012, 7:36 AM

    Re: Cancel the browse dialogue

    Hi Andy,

     

    Please try the way below. handlebrowse will fire when the user click on the uploader button, you can achieve your own logic in it.

     

    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 runat="server">  
    6.     <title>example</title>  
    7. </head>  
    8. <body>  
    9.     <form id="form1" runat="server">  
    10.         <table>  
    11.             <tr>  
    12.                 <td>  
    13.                     store path:  
    14.                 </td>  
    15.                 <td>  
    16.                     <asp:TextBox ID="tbPath" runat="server"></asp:TextBox>  
    17.                 </td>  
    18.             </tr>  
    19.             <tr>  
    20.                 <td>  
    21.                 </td>  
    22.                 <td>  
    23.                     <CuteWebUI:Uploader ID="Uploader1" runat="server">  
    24.                     </CuteWebUI:Uploader>  
    25.                 </td>  
    26.             </tr>  
    27.         </table>  
    28.     </form>  
    29. </body>  
    30. </html>  
    31.   
    32. <script type="text/javascript">  
    33. var uploader1=document.getElementById('<%=Uploader1.ClientID%>')  
    34. var tbPath=document.getElementById('<%=tbPath.ClientID%>')  
    35. uploader1.handlebrowse=function()  
    36. {  
    37.  if(tbPath.value==null||tbPath.value=="")  
    38.  {  
    39.  alert("please select the store path");  
    40.  return false;  
    41.  }  
    42. }  
    43. </script>  
     

    Regards,

     

    Ken 

View Complete Thread