How to get selected value from ASP.NET RadioButtonList using JQuery. Below code will give you the Solution. var radioValue = $('#<%=RadioButtonList1. ClientID %> input[type=radio]:checked').
string test = rb. SelectedValue; //May work fine SomeMethod(rb. SelectedValue);
The ASPX code will look something like this:
<asp:RadioButtonList ID="rblist1" runat="server">
<asp:ListItem Text ="Item1" Value="1" />
<asp:ListItem Text ="Item2" Value="2" />
<asp:ListItem Text ="Item3" Value="3" />
<asp:ListItem Text ="Item4" Value="4" />
</asp:RadioButtonList>
<asp:Button ID="btn1" runat="server" OnClick="Button1_Click" Text="select value" />
And the code behind:
protected void Button1_Click(object sender, EventArgs e)
{
string selectedValue = rblist1.SelectedValue;
Response.Write(selectedValue);
}
Using your radio button's ID, try rb.SelectedValue
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With