0

I want to get the selected radio button value in C#. I used the following code for radio button.

<input id="C" type="radio" name ="language" value ="C" /> <label for = "C">C</label> <br>
<input id="C++" type="radio" name ="language" value ="C++" /> <label for = "C++">C++</label> <br>
<input id="C#" type="radio" name ="language" value ="C#" /> <label for = "C#">C#</label> <br>
<input id="VB" type="radio" name ="language" value ="VB" /> <label for = "VB">VB</label> <br>

Now i want to get the selected radio button value in C#.

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
Balaji Kondalrayal
  • 1,743
  • 3
  • 19
  • 38

2 Answers2

0

Request.Form("language") should work

ale
  • 10,012
  • 5
  • 40
  • 49
0

Try this…

if (Request.Form["language"] != null)
{
     string value = Request.Form["language"].ToString();
}
Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
JayDeep Nimavat
  • 476
  • 6
  • 22