一、html表单控件
<input type="radio" name="nw" value="1" title="内网" checked="" runat="server"> <input type="radio" name="nw" value="2" title="外网" runat="server">
获取值:
Request.Form["nw"].ToString()
二、RadioButtonList服务器控件(单选框)
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal"> <asp:ListItem Value="1" Selected="True">男</asp:ListItem> <asp:ListItem Value="2">女</asp:ListItem> </asp:RadioButtonList>
获取值:
//获取Text的值 RadioButtonList1.SelectedItem.Text //获取Value的值 RadioButtonList1.SelectedItem.Value