Generic EditorTemplate for an Enum with Text Select Option Value
问题 I have been using this editor template for enums: @model Enum @{ var htmlAttributesFromView = ViewData["htmlAttributes"] ?? new { }; var htmlAttributes = Html.MergeHtmlAttributes(htmlAttributesFromView, new { @class = "form-control" }); } <div class="form-group"> @Html.LabelFor(model => model, htmlAttributes: new { @class = "control-label col-md-3" }) <div class="col-md-8"> @Html.EnumDropDownListFor(x => x, htmlAttributes) @Html.ValidationMessageFor(model => model) </div> <a class=