Sunday 15 September 2013

How to select only one radio button from two or more radio buttons without writing any code in Asp.Net.

In this article, I have explained how to select only one radio button from multiple radio buttons without writing any code in asp.net. It’s very easy to select single radio button from multiple radio buttons. Let’s take an example.

Put two radio buttons control on design page. Select the first radio button and go to the properties of that radio button and give a name to Group Name. I have given group name as one (you can give group name according to your requirement).

<asp:RadioButton ID="RadioButton1" runat="server" GroupName="one" />
<asp:RadioButton ID="RadioButton2" runat="server" GroupName="one" />

GroupName property to specify a grouping of radio buttons to create a mutually exclusive set of controls. You can use the GroupName propery to select single radio button from multiple selection option from radio buttons control.


The value of this property is stored in view state.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.