.net中單選按鈕RadioButton,RadioButtonList 以及純Html中radio的用法,區別? RadioButton實例及說明: <asp:RadioButton ID="publicHas" Checked="true" runat="server" CssClass="radioMiddle" Text="所有人可見" GroupName="mm"/> <asp:RadioButton ID="privateHas" runat="server" CssClass="radioMiddle" Text="僅自己可見" GroupName="mm" /> <asp:RadioButton ID="friendHas" runat="server" CssClass="radioMiddle" Text="僅好友可見" GroupName="mm" /> .net后台處理方式: if (privateHas.Checked == true) model.Limits = 0; if (friendHas.Checked == true) model.Limits = 1; if (publicHas.Checked == true) model.Limits = 2; RadioButtonList在.net中跟DropDownList用法相似,可以看成集合: <asp:RadioButtonList ID="rbImg" Name="rbImg" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"> <asp:ListItem Value="1">是</asp:ListItem> <asp:ListItem Value="0" Selected="True">否</asp:ListItem> </asp:RadioButtonList> .net后台處理方式: this.radCid.SelectedValue = project.Cid; radio 將name設置為相同的值 <input type="radio" name="sex" value="1" checked="checked"></input>男 <input type="radio" name="sex" value="0" ></input>女 .net后台處理方式: 通過Request.Form["sex"].ToString();獲取