Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何在vb.net中访问RadioButtonList中的radiobutton_Asp.net_Css_Vb.net_Radiobuttonlist - Fatal编程技术网

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