Can I add attributes to a radio button?

  • Thread starter Thread starter cthu
  • Start date Start date
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!
 
Back
Top