Enum DropDownList in MVC 5.1

With the release of MVC 5.1, there finally came enum support it View. There is an older and even stable approach that is still usable. There are plenty of resources that can be found on the web but this one is much simpler.

 

You’ll be needing the following:

Visual Studio 2012: ASP.NET and Web Tools 2013 for VS 2012.

Visual Studio 2013: Visual Studio 2013 Update 1. This is needed for editing ASP.NET MVC 5.1 Razor Views.

Now that you have the tools, lets get started.

 

First create an ASP.NET Web Application.

To demonstrate enum support, let’s build a simple student registration form where we expect that dropdown box will show the gender, country, etc.

Read the rest of the post here: http://www.codeproject.com/Articles/776908/Dealing-with-Enum-in-MVC

Leave a Reply

Your email address will not be published. Required fields are marked *