开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜