Ниже приведен рабочий код.
Модель
public enum AllEnum
{
ABC,
EFG,
QWE
}
public class SimpleModel
{
public AllEnum Selected { get; set; }
}
Контроллер
public class HomeController : Controller
{
[HttpGet]
public ActionResult Index()
{
var model = new SimpleModel();
return View(model);
}
[HttpPost]
public ActionResult Index(SimpleModel model)
{
return View(model);
}
}
Вид
@using SimpleMVC.Models
@model SimpleMVC.Models.SimpleModel
@using (Html.BeginForm())
{
@Html.RadioButtonFor(m => m.Selected, AllEnum.ABC) <label>ABC</label>
@Html.RadioButtonFor(m => m.Selected, AllEnum.EFG)<label>EFG</label>
@Html.RadioButtonFor(m => m.Selected, AllEnum.QWE)<label>QWE</label>
<input type="submit" />
}