一、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