Radio.Attributes.Add does nothing!

G

Guest

Hi

I'm trying to create some JS to enable/disable some form elements when a
radio button grp is set to a certain option.

However, the Attributes.Add method does nothing...

html..

<asp:radio button id="rdoOption1" runat="server" GroupName="ioptions" />

c# page_load..

rdoOption1.Attributes.Add("onchange", "javascript:changeoption");

The rdoOption1 is declared as protected
System.Web.UI.WebControls.RadioButton. However, it creates no code. When I
look at the HTML, there is no mention of the onchange event.

What's missing?

Cheers


Dan
 
A

Angrez Singh

Hi,

Use HtmlInputRadioButton for adding the attribute.

HTH,

Regards,
Angrez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top