Can I add attributes to a radio button?

C

cthu

Hello
I would like some client side events to fire when controls are edited.
Right now I have:

For Each ctl In myForm.Controls

Select Case ctl.GetType().ToString

Case "System.Web.UI.WebControls.TextBox"

CType(ctl, TextBox).Attributes.Add("OnChange", "DirtyPage()")

Case "System.Web.UI.WebControls.RadioButton"

CType(ctl, RadioButton).Attributes.Add("OnChange", "DirtyPage()")

Case "System.Web.UI.WebControls.DropDownList"

CType(ctl, DropDownList).Attributes.Add("OnChange", "DirtyPage()")

End Select

Next ctl



This will add the attribute to the text box and drop downs, but not the
Radio buttons. I tried replacing "RadioButton" with "RadioButtonList" but
that didn't work.



Thanks!
 

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

Top