62,046
社区成员
发帖
与我相关
我的任务
分享
string sex = "";
//从数据库中获取性别 比如女
if(sex == "女")
{
RadioButton2.Checked = Ture;
}else
{
RadioButton1.Checked = Ture;
}
string sex = "";
//从数据库中获取性别 比如女
if(sex == "女")
{
RadioButton2.Checked;
}else
{
RadioButton1.Checked;
}
<asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True" Checked="True"
Font-Size="Small" GroupName="selectView" Text="男" OnCheckedChanged="RadioButton1_CheckedChanged" />
<asp:RadioButton ID="RadioButton2" runat="server" AutoPostBack="True" Font-Size="Small"
GroupName="selectView" Text="女"
oncheckedchanged="RadioButton2_CheckedChanged" />
if(RadioButton1.Checked){
//code选中男
}else if(RadioButton2.Checked)
{
//code选中女
}