Код модели
public partial class Login
{
[Required(ErrorMessage = "This field is required")]
public Role Status { get; set; }
public string LoginErrorMessage { get; set; }
}
public enum Role
{
Manager,
Employee
}
*. Cs html код
<div class="form-group">
@Html.LabelFor(model => model.Status)
<br />
@Html.DropDownListFor(model => model.Status, new
SelectList(Enum.GetValues(typeof(Role))),
new { @class = "form-control" },
"Select Role")
@Html.ValidationMessageFor(model => model.Status, "", new { @class = "text-
danger" })
</div>
Этот Html код не распознает «Роль» в функции typeof ().