Passing selected value from the radio buttons to the controller in MVC

Either make a hidden field for every radio button or change you radio buttons like this

@Html.RadioButtonFor("Answer1", new { @id = 1 })

Add property:

public string SelectedAnswer { get; set; }

Add in view:

@Html.RadioButtonFor(m => m.SelectedAnswer, "Answer1")
@Html.RadioButtonFor(m => m.SelectedAnswer, "Answer2")
@Html.RadioButtonFor(m => m.SelectedAnswer, "Answer3")
@Html.RadioButtonFor(m => m.SelectedAnswer, "Answer4")

In controller it postback the value according to selected radio button... i.e. either Answer1, or Answer2, etc.


If you are giving same name for your radio buttons, then you can try the following code

Controller

[HttpPost]
public ActionResult Index(string Answer)
{
    return View();
}

View

@using (Html.BeginForm("Index", "Demo"))
{
       @Html.RadioButton("Answer", "A") <span>A</span> 
       @Html.RadioButton("Answer", "B") <span>B</span> 

    <input type="submit" value="Next" />
}