views:

595

answers:

2
<input type="radio" name="group1" />1
<input type="radio" name="group1" />2

How do i know witch one is selected when the form is posted ?

+3  A: 

The inputs should have values:

<input type="radio" name="group1" value="1" />1
<input type="radio" name="group1" value="2" />2

Then, the value will be posted on the name group1. On Asp.net you can get it using:

Request.Form["group1"]
Kobi
Request.Form["group1"] returns null !
Yassir
Try `Request["group1"]` to make sure. If that doesn't work you're posting it wrong.
Kobi
A: 

If you are using runat="server", it can happen that name attribute is changed at client, so you will get null as value.

ivan