Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • @SegmentationFault why? Can you describe your problem? Which version of .NET/MVC do you use? What error have you got? Please be more specific. Commented Aug 31, 2016 at 12:17
  • 7
    Because it only works for Dropdowns, not anywhere else. Commented Sep 1, 2016 at 6:47
  • 2
    Doesn't seem to exist in .net core Commented Jan 19, 2017 at 15:40
  • 3
    .net core uses Html.GetEnumSelectList(typeof(YourEnum)) @Lonefish Commented Mar 29, 2017 at 17:20
  • 2
    if we want to use the @Html.DisplayFor(yourEnumField) we can put a Enum.cshtml in the DisplayTemplates directory (in shared directory). in this file we need to put just 2 lines. the first is: "@model Enum" the second is: "@GetDisplayName(Model)." the GetDisplayName method needs to be as in @Bernoulli IT answare Commented May 8, 2017 at 0:47