Release Candidates for ASP.NET MVC 5.1

Posted on Updated on

Attribute Routing

The Attribute Routing will now support the constraints, versioning enabled and header based route section. Many aspects of attribute routes are now customizable via the IDirectRouteProvider interface and RouteProviderAttribute class.

There’s a Web API-based sample here:
the concepts are the same as MVC.

Bootstrap support in HTML Helpers

Now, you can pass HTML attributes in Html.EditorFor as an anonymous object. This means you can pass in Bootstrap styles in HtmlHelpers and style the various input elements such as textboxes, dropdownlist etc. with the correct Bootstrap styles.

Support for Enums

Now in ASP.NET MVC 5.1, the Enum type will be supported in Views. The new HTML Helper Html.EnumDropDownListFor() added will generate a dropdown when binding to Enum types. For this you need to declare an Enum as follows:

When you use the EnumDropDownListFor Helper, it will generate the following view when you are creating an Enum. You can see a full sample at:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s