This is a migrated thread and some comments may be shown as answers.

Enable/Disable RadUpload

4 Answers 251 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Lynne
Top achievements
Rank 1
Lynne asked on 22 Mar 2012, 12:50 AM

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;

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Mar 2012, 08:09 AM
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.
0
Dimitar Terziev
Telerik team
answered on 22 Mar 2012, 09:41 AM
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.
0
Lynne
Top achievements
Rank 1
answered on 22 Mar 2012, 03:51 PM

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.

0
Princy
Top achievements
Rank 2
answered on 23 Mar 2012, 06:46 AM
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.
Tags
Upload (Obsolete)
Asked by
Lynne
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Dimitar Terziev
Telerik team
Lynne
Top achievements
Rank 1
Share this question
or