1) SelectedIndex
2) SelectedItem
HTML
<asp:RadioButtonList ID="RadioButtonList1"
runat="server">
<asp:ListItem Value="0" Selected="True">YES</asp:ListItem>
<asp:ListItem Value="1">NO</asp:ListItem>
</asp:RadioButtonList>
Sometime you need to check to
see if a value has been selected before you do anything in coding
CS Code
if
(RadioButtonList1.SelectedItem != null)
{
RadioButtonList1.SelectedItem.Selected = false;
}
Or
if(RadioButtonList1.SelectedIndex<>-1)
{
RadioButtonList1.SelectedItem.Selected=false;
}
Comments
Post a Comment