Hide Browse Button

Last post 03-26-2009, 10:15 AM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  03-26-2009, 9:57 AM 50307

    Hide Browse Button

    Hi,
     
    Can you please provide the syntax required to hide the Browse Button as well as the Progress Bar once the upload is complete?  The only thing I want to see is the file name when the upload finishes.
     
    Thanks!
     
    TML
  •  03-26-2009, 10:15 AM 50308 in reply to 50307

    Re: Hide Browse Button

    TML:
     
    If you are using AJAX , you can just hide the uploader of the FileUploaded event.
     
    If not, this code may help you :
     
    1. <%@ Page Language="C#" %>  
    2. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>  
    3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   
    4.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5. <script runat="server">  
    6.     protected void Uploader1_FileUploaded(object sender, UploaderEventArgs args)   
    7.     {   
    8.         //args.MoveTo(...)   
    9.         servermsg.Text = args.FileName + " have been uploaded";   
    10.         Uploader1.Visible = false;   
    11.     }   
    12. </script>  
    13. <html xmlns="http://www.w3.org/1999/xhtml">  
    14. <head runat="server">  
    15.     <title>Sample</title>  
    16.     <script type="text/javascript">  
    17.     var selectedlist;   
    18.     function CuteWebUI_AjaxUploader_OnSelect(list)   
    19.     {   
    20.         selectedlist=list;   
    21.     }   
    22.     function CuteWebUI_AjaxUploader_OnPostback()   
    23.     {   
    24.         document.getElementById("uploadedmsg").innerHTML=selectedlist[0].FileName+" is uploaded";   
    25.         this.internalobject.insertBtn.style.display="none";   
    26.         return false;   
    27.     }   
    28.     </script>  
    29. </head>  
    30. <body>  
    31.     <form id="form1" runat="server">  
    32.         <div>  
    33.             <asp:Label runat="server" ID="servermsg" ForeColor="red" Font-Bold="true" />  
    34.             <span id="uploadedmsg"></span>  
    35.             <CuteWebUI:Uploader runat="server" ID="Uploader1" OnFileUploaded="Uploader1_FileUploaded" />  
    36.             <hr />  
    37.             <asp:Button runat="server" ID="SubmitButton" Text="Submit" />  
    38.         </div>  
    39.     </form>  
    40. </body>  
    41. </html>  
     
    Regards,
    Terry
     
View as RSS news feed in XML