2015/08/10

Apply Enum onto @Html.DropDownListFor

enum GenderType
{
    male,
    femail,
    others
}
@Html.DropDownListFor(model => model.Gender, new SelectList(Enum.GetValues(typeof(GenderType))))

No comments:

Post a Comment