Enable/Disable RadUpload

Thread is closed for posting
5 posts, 0 answers
  1. Lynne
    Lynne avatar
    25 posts
    Member since:
    Oct 2010

    Posted 21 Mar 2012 Link to this post

    I have some javascript that fires with the OnClientCheckChanged event of 2 radio buttons.  It enables/disables the RadUpload control on the page depending on the radio button selected (see client code below).  This code works fine until the page posts back to the server (see server code below), at which point I cannot enable the RadUpload control with the client code.   I think I may need to enable/disable the individual buttons inside RadUpload (Select and Clear) on the server, but I'm not sure how to access them.  Any help would be appreciated.

    client code

    var newDocButton = $find("<%= RadButton1.ClientID %>");
    var newLinkButton = $find("<%= RadButton2.ClientID %>");
    var upload = GetRadUpload("<%= RadUpload1.ClientID %>");
                
    if (newDocButton.get_checked()) 
        upload.Enabled = false;
    else 
        upload.Enabled = true;

    server code  

    if (RadButton1.Checked)
        RadUpload1.Enabled = true;
    else
        RadUpload1.Enabled = false;
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Mar 2012 Link to this post

    Hello,

    I am not quite sure about your requirement and I suppose you want to disable the RadUpload in server side. I tried your code in Telerik versions 2011, 2, 712, 35 and 2012, 1, 215, 35 and I could enable/disable the RadUpload. Please elaborate your scenario if it doesn't help.


    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 22 Mar 2012 Link to this post

    Hi,

    In order to enable the RadUpload using client-side code, try the set_enabled method. A sample page is attached.

    Regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Lynne
    Lynne avatar
    25 posts
    Member since:
    Oct 2010

    Posted 22 Mar 2012 Link to this post

    Thanks Dimitar.  Your code resolved the problem.  I was using javascript code I found in response to another post, but I think it was outdated.

    Can you point me to the Telerik documentation for RadUpload that discusses set_enabled?  Prior to posting my question, I read
    through most of the RadUpload documentation online including Client-Side Basics, Client-Side Events, RadUpload Client Object, and Application Scenarios, but I never found a discussion of set_enabled. Thanks for your help.

  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Mar 2012 Link to this post

    Hi Lynne,

    The documentation illustrates some basic properties and functions. It does not cover all available methods/ properties. You can use tools like QuickWatch and Firebug to get all the client side methods and properties.

    Thanks,
    Princy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017