Disable Ajax Uploader

Last post 01-24-2014, 7:25 AM by Kenneth. 5 replies.
Sort Posts: Previous Next
  •  01-21-2014, 8:17 AM 78796

    Disable Ajax Uploader

    Hello, I would know how can I disable or enable Ajax Uploader control from Code Behind, since if I set Enabled = false to the button it shows another button to upload. 

     

    Thank you 

  •  01-22-2014, 8:27 AM 78806 in reply to 78796

    Re: Disable Ajax Uploader

     Hi cyphersys,

     

    Please use property "Visible". set it to false will hide the uploader control.

     

      Uploader1.Visible = false; 

     

    Regards,

     

    Ken 

  •  01-22-2014, 8:31 AM 78808 in reply to 78806

    Re: Disable Ajax Uploader

    Hello Kenneth,

     

    I have tried that but when I am using a custom button and I set Visible = false it appear other default upload button generated by Ajax Uploader. 

     

    Regards 

  •  01-23-2014, 8:06 AM 78815 in reply to 78808

    Re: Disable Ajax Uploader

    Hi cyphersys,

     

    If you are using custom button as the upload button, then disable the custom button directly, like the example below.

     

    1. <%@ Page Language="C#" AutoEventWireup="True" %>  
    2.   
    3. <%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="ajaxuploader" %>  
    4. <html>  
    5. <head>  
    6.     <script runat="server">  
    7.   
    8.         protected override void OnLoad(EventArgs e)  
    9.         {  
    10.             myUploader.Enabled = false;  
    11.             base.OnLoad(e);  
    12.         }  
    13.     </script>  
    14. </head>  
    15. <body>  
    16.     <form id="Form1" runat="server">  
    17.         <CuteWebUI:UploadAttachments runat="server" ID="Uploader1" InsertButtonID="myUploader">  
    18.         </CuteWebUI:UploadAttachments>  
    19.         <asp:Button ID="myUploader" runat="server" Text="Custom upload button" />  
    20.     </form>  
    21. </body>  
    22. </html>  
     

    Regards,

     

    Ken 

  •  01-23-2014, 2:33 PM 78818 in reply to 78815

    Re: Disable Ajax Uploader

    Hello Kenneth,

     

    My first option was try to disable the button. But when I set "enabled" false the button and click it, it shows me the open select file modal dialog.

     

    Thank you 

  •  01-24-2014, 7:25 AM 78823 in reply to 78818

    Re: Disable Ajax Uploader

     Hi cyphersys,

     

    Did you tried the example page I provided? Does it get the same problem too?

     

    Regards,

     

    Ken 

View as RSS news feed in XML