BuildFeed/Views/shared/EditorTemplates/Enumeration.cshtml
2014-10-28 23:39:18 +00:00

15 lines
485 B
Plaintext

@using System.ComponentModel.DataAnnotations
@model Enum
@{
var values = Enum.GetValues(ViewData.ModelMetadata.ModelType).Cast<object>()
.Select(v => new SelectListItem
{
Selected = v.Equals(Model),
Text = DisplayHelpers.GetDisplayTextForEnum(v),
Value = v.ToString()
});
}
@Html.DropDownList("", values, new { @class = "form-control" })