add one radio button into 2 groups
I know this is probably very elementary, but I can't seem to figure it out. I need radio buttons that are mutually exclusive horizontally as well开发者_JS百科 as vertically. How can I assign a radio button to two groups? Thanks in advance.
You must set GroupName property in RadioButton.
for example:
<asp:RadioButton ID="rbtnOne" runat="server" Text="One" GroupName="Number" />
<asp:RadioButton ID="rbtnTwo" runat="server" Text="Two" GroupName="Number" />
<asp:RadioButton ID="rbtnMan" runat="server" Text="Man" GroupName="Sex" />
<asp:RadioButton ID="rbtnWoman" runat="server" Text="Woman" GroupName="Sex" />
or use RadioButtonList control
<asp:RadioButtonList ID="rbtnListExample" runat="server">
<asp:ListItem Text="TestOne" />
<asp:ListItem Text="TestTwo" />
<asp:ListItem Text="TestThree" />
</asp:RadioButtonList>
精彩评论