asp.net 一个radiobutton组,怎么得到选择的那个值
来源:百度知道 编辑:UC知道 时间:2024/06/10 00:39:48
this.RadioButtonList1.SelectedItem.Text.ToString();
<pre t="code" l="csharp"> //.aspx页面<br /> <asp:RadioButton ID="RadioButton1" runat="server" GroupName="testGroup" Checked="true" Text="RadioButton1"/><br /> <asp:RadioButton ID="RadioButton2" runat="server" GroupName="testGroup" Text="RadioButton2"/><br /> <br /> //.cs页面:使用Checked属性做判断<br /> if (RadioButton1.Checked)<br /> {<br /> //选择RadioButton1<br /> }<br />