I\'m trying to pass this selected radio button value from the razor view to the controller.... can someone please give me an idea how to do this?..................... My Vi
Add the following source code to View:
@Html.RadioButtonFor(m => m.Role, "1" ) A @Html.RadioButtonFor(m => m.Role, "0" ) B @Html.HiddenFor(m=>m.Role)
You can put the selected value to this HiddenField: @Html.HiddenFor(m=>m.Role) and send it to controller via [HttpPost] prototype.
@Html.HiddenFor(m=>m.Role)