@model Enum
@foreach (var value in Enum.GetValues(Model.GetType()))
{
@Html.RadioButtonFor(m => m, value)
@Html.Label(value.ToString())
}
@model MvcTest.Models.Airlines
@foreach (var value in Enum.GetValues(typeof(MvcTest.Models.Airlines)))
{
@Html.RadioButtonFor(m => m, value)
@Html.Label(value.ToString())
}
public class TestModel
{
[Required(ErrorMessage = "select one item")]
public Airlines Airline { get; set; }
}