public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
selectRB('F'); //calling function
}
public void SelectRB(char Option)
{
if (Option == 'M')
{
Rb.SelectedIndex = 0; // Selects Male
}
else
{
Rb.SelectedIndex = 1; // Selects Female
}
}
}
<asp:RadioButtonList ID="Rb" runat="server" AutoPostBack="false">
<asp:ListItem Text="Male" Value="M"></asp:ListItem>
<asp:ListItem Text="Female" Value="F"></asp:ListItem>
</asp:RadioButtonList>
This helps you, Mark Answer if this helps you
Thanks
Pavan Kumar
Mark Answer if this fits the need
Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator