asp.net中如何获取radioButton选中的值

谁知道的请给于指点谢谢了
就是在做注册时,如何拿到radioButton中用户选择的性别,谢谢给予指点

建议用 RadioButtonList好些,
.aspx 代码:

<asp:RadioButtonList ID="RadioButtonList1" runat="server"
RepeatDirection="Horizontal">
<asp:ListItem>男</asp:ListItem>
<asp:ListItem>女</asp:ListItem>
</asp:RadioButtonList>
.cs代码
//获取RadioButtonList 中用户选择的性别

string sex =RadioButtonList1.SelectedItem.Text
温馨提示:内容为网友见解,仅供参考
第1个回答  2010-06-27
RadioButton1,男
RadioButton2,女
写入数据库的性别(sex)列;
if(RadioButton1.Checked)
{
sex="男";
}
if (RadioButton2.Checked)
{
sex = "女";
}
第2个回答  2010-06-27
如aspx页有两个radioButton
一个radioButton1(男的)
一个radioButton2(女的)
程序上
if(radioButton1.checked=true)
{
response.write("男");
}
else
{
response.write("女");
}
第3个回答  2010-06-29
selected 加判断 直接控件点selected()判断就可以了
第4个回答  2010-06-27
问题未表述清楚,无法作答