Asp.net 如何在vb.net中访问RadioButtonList中的radiobutton
我想在填充Asp.net 如何在vb.net中访问RadioButtonList中的radiobutton,asp.net,css,vb.net,radiobuttonlist,Asp.net,Css,Vb.net,Radiobuttonlist,我想在填充RadioButtonList时更改RadioButtonList的CssClass。我不知道绑定列表时如何访问单选按钮。我是否需要使用DataBind或DataBounding事件?怎么做 使用该事件,因为此时将填充所有单选按钮 Private Sub YourRadioButtonList_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles YourRadioButtonList.DataBo
RadioButtonList
时更改RadioButtonList的CssClass
。我不知道绑定列表时如何访问单选按钮。我是否需要使用DataBind
或DataBounding
事件?怎么做 使用该事件,因为此时将填充所有单选按钮
Private Sub YourRadioButtonList_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles YourRadioButtonList.DataBound
For Each rd As RadioButton In YourRadioButtonList.Items
'Or some other condition that determines the CSS Class.
If rd.Checked Then
rd.CssClass = "NewCssClass"
End If
Next
End Sub