Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, September 3, 2012 1:46 PM
Hi,
List of radio button like below
@{ var y = 0;
var rname="";
foreach (var boolSettingList in Model.Incidents)
{
rname="Iradio" + @boolSettingList.Id.ToString();
if (y == 0)
{
<text><tr></text>
<td><b>Incident was determined to be:</b> (see page 3)</td>
}
<td>
<input type="radio" name="radioIValue" id=@rname value="Free" checked="checked" />
@boolSettingList.DisplayName
</td>
++y;
if (y == 5)
{
@Html.Raw("</tr>")
y = 1;
}
}
When i try to read read button valuew using Request.Form its return null value. why that
lakmal
All replies (7)
Tuesday, September 4, 2012 2:50 AM ✅Answered
Hi,
I have 3 radio button with same name. becouse only one radio button can select so i keep same name. How can i identify wich radio button is selected?
What you should do is change the html like this-
<input type="radio" name="radioIValue" id=@rname value=@rname checked="checked" />
As the name is same so while you submit the form, Request.Form["radioIValue"] will hold the value of the corresopnding radio button that is rname. That means that particular radio button is selected and others are not.
Monday, September 3, 2012 10:43 PM
i try to read read button valuew using Request.Form its return null value
Request.Form['??"]
?
Monday, September 3, 2012 11:35 PM
Please use request.form[radiobuttonname as string]
Tuesday, September 4, 2012 12:52 AM
Please use :Request.Form["radioIValue"]
Tuesday, September 4, 2012 1:09 AM
Hi,
Try -
Request.Form["radioIValue"]
Tuesday, September 4, 2012 2:19 AM
I have 3 radio button with same name. becouse only one radio button can select so i keep same name. How can i identify wich radio button is selected?
Tuesday, September 4, 2012 2:47 AM
I have 3 radio button with same name. becouse only one radio button can select so i keep same name. How can i identify wich radio button is selected?
give different
value