Inactivate or hide browse button

Last post 07-01-2010, 8:49 AM by jas101. 4 replies.
Sort Posts: Previous Next
  •  06-18-2010, 10:38 AM 61867

    Inactivate or hide browse button

    Using CuteWebUI:UploadAttachments is there a way to inactivate or hide the select files button after an upload. I am using the example below and the button disapears while i am uploading muliple files but when it finishes and displays the completed files list it reappears.
     
    function CuteWebUI_AjaxUploader_OnStart() {

    var hidden = document.getElementById('<%=Uploader1.ClientID %>');

    hidden.internalobject.insertBtn.style.display = 'none'

    }

     
  •  06-21-2010, 3:26 AM 61890 in reply to 61867

    Re: Inactivate or hide browse button

    Hi jas101,
     
    try this way
    1. <%@ Page Language="C#" AutoEventWireup="True" %>   
    2.   
    3. <%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="CuteWebUI" %>   
    4. <html>   
    5.   
    6. <script language="C#" runat="server">   
    7.     
    8.     protected void attachment1_FileUploaded(object sender, UploaderEventArgs args)   
    9.     {   
    10.         attachment1.Visible = false;   
    11.     }   
    12. </script>   
    13.   
    14. <body>   
    15.     <form id="Form1" runat="server">   
    16.         <CuteWebUI:UploadAttachments ID="attachment1" runat="server" OnFileUploaded="attachment1_FileUploaded">   
    17.         </CuteWebUI:UploadAttachments>   
    18.     </form>   
    19. </body>   
    20. </html>  

    Regards,
     
    ken
  •  06-21-2010, 10:02 AM 61898 in reply to 61890

    Re: Inactivate or hide browse button

    Thanks for the reply.  It works but the problem is it removes the button along with the results table.  I would like to reproduce the effect of when you hit the maxfileslimit and the browse button grays out.  I wonder if i can dynamically trigger the maxfileslimit property.
  •  06-21-2010, 11:33 PM 61921 in reply to 61898

    Re: Inactivate or hide browse button

    Hi jas101,
     
    Try
     
    1. <%@ Page Language="C#" AutoEventWireup="True" %>   
    2.   
    3. <%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="CuteWebUI" %>   
    4. <html>   
    5.   
    6. <script language="C#" runat="server">      
    7.        
    8.     protected void attachment1_FileUploaded(object sender, UploaderEventArgs args)   
    9.     {   
    10.         button1.Enabled = false;   
    11.     }      
    12. </script>   
    13.   
    14. <body>   
    15.     <form id="Form1" runat="server">   
    16.      <asp:Button ID="button1" runat="server" Text="upload" />   
    17.         <CuteWebUI:UploadAttachments ID="attachment1" runat="server" OnFileUploaded="attachment1_FileUploaded"  
    18.             InsertButtonID="button1">   
    19.         </CuteWebUI:UploadAttachments>   
    20.           
    21.     </form>   
    22. </body>   
    23. </html>  

    And you can change the maxfileslimit dynamically in codebehind, like.
     
    1. protected override void OnLoad(EventArgs e)   
    2.    {   
    3.        attachment1.MaxFilesLimit = 3;   
    4.    }  

    Regards,
     
    ken
  •  07-01-2010, 8:49 AM 62186 in reply to 61921

    Re: Inactivate or hide browse button

    thanks for the help
View as RSS news feed in XML