我正在使用asp.net中的单选按钮列表控件。 我试图获得选定的值按钮点击事件 但我越来越Empty string
,我希望它没有JavaScript。单选按钮不返回选定的值
我该怎么做?
<asp:RadioButtonList ID="RadioButtonList1" EnableViewState="true" runat="server"
Width="287px">
<asp:ListItem Value="Single" runat="server" Text="Single"></asp:ListItem>
<asp:ListItem Value="Jointly" runat="server" Text="Married Filing Jointly/Widower"></asp:ListItem>
<asp:ListItem Value="Separately" runat="server" Text="Married Filing Separately"></asp:ListItem>
<asp:ListItem Value="Household" runat="server" Text="Head Of Household "></asp:ListItem>
</asp:RadioButtonList>
C#代码
protected void btnCalculate_Click(object sender, EventArgs e)
{
string selectedValue = RadioButtonList1.SelectedValue;
}
请告诉我的代码 – HatSoft
你能后你有这么远的代码? –
我已编辑我的问题 –