在ASP.NET Web应用中,可以使用ASP.NET的RadioButton控件来实现单选按钮(RadioButton)。以下是一个简单的示例:
<asp:RadioButtonList ID="RadioButtonList1" runat="server"> <asp:ListItem Text="Option 1" Value="1"></asp:ListItem> <asp:ListItem Text="Option 2" Value="2"></asp:ListItem> <asp:ListItem Text="Option 3" Value="3"></asp:ListItem></asp:RadioButtonList>在代码后端中,可以通过以下方式来获取选中的单选按钮的值:
string selectedValue = RadioButtonList1.SelectedValue;也可以通过以下方式来检查哪个单选按钮被选中:
if (RadioButtonList1.SelectedItem != null){ string selectedText = RadioButtonList1.SelectedItem.Text; string selectedValue = RadioButtonList1.SelectedItem.Value;}这样就可以在ASP.NET Web应用中实现单选按钮(RadioButton)的功能。


