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
  • 116,671
  • 27
  • 221
  • 298
Balaji Kondalrayal
  • 1,668
  • 2
  • 17
  • 37

2 Answers2

0

Request.Form("language") should work

alessandro
  • 9,507
  • 5
  • 35
  • 46
0

Try this…

if (Request.Form["language"] != null)
{
     string value = Request.Form["language"].ToString();
}
Giacomo1968
  • 23,903
  • 10
  • 59
  • 92
JayDeep Nimavat
  • 478
  • 6
  • 22