protected void Button1_Click(object sender, EventArgs e)
{
if (RadioButton1.Checked)
{
int a = +10;
}
else
{
int a = -10;
}
if (RadioButton2.Checked)
{
int b = +10;
}
else
{
int b = -10;
}
}
}
How to count the number of radio buttons selected in asp.net
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Mar 6, 2015, 10:48 PM EST
.FirstOrDefault(r => r.Checked);
Note that this requires that all of the radio buttons be directly in the same container (eg, Panel or Form), and that there is only one group in the container. If that is not the case, you could make List