Your official information source from the .NET Web Development and Tools group at Microsoft.
Today we shipped release candidates for ASP.NET MVC 5.1, ASP.NET Web Pages 3.1 and Web API 2.1 to the NuGet gallery. In this release we are previewing some of the runtime features in ASP.NET and Web Tools 2013.2, which will include a broader set of updates to ASP.NET SignalR, ASP.NET Identity, Entity Framework, and the Microsoft OWIN Components as well as tooling updates to the Web Editors, Browser Link, Scaffolding, NuGet and Windows Azure WebSite publishing. We will be previewing all of these features along the way before all of the features are released.
You can download the release candidates for ASP.NET MVC 5.1, Web API 2.1, Web Pages 3.1 as preview NuGet packages from the NuGet gallery. You can install or update to these pre-release packages through NuGet using the NuGet Package Manager Console, like this:
Please remember to select the “Include Prerelease” option when searching for packages using the NuGet Package Manager or the Package Manager Console. For more information on how to install pre-release packages please read http://docs.nuget.org/docs/Reference/Versioning#Prerelease_Versions and http://docs.nuget.org/docs/release-notes/nuget-1.7#Show_prerelease_packages_in_the_Manage_NuGet_packages_dialog
You can find a complete listing of the features and fixes included in this release by referring to the release notes.
Check out some highlights of the new features included in this release below.
Attribute routing now supports constraints, enabling versioning and header based route selection. There's a Web API-based sample here: (https://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/RoutingConstraintsSample/ReadMe.txt); the concepts are the same as MVC.
Bootstrap support in HTML Helpers
We now allow passing in 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
We have added support in ASP.NET MVC 5.1 for using Enum Types in MVC views. We have added a new HTML Helper Html.EnumDropDownListFor() which will generate a dropdown when binding to Enum Types. For eg. if you have 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: https://aspnet.codeplex.com/SourceControl/latest#Samples/MVC/EnumSample/
Global Error Handling
In ASP.NET Web API, there is a centralized way to logged all unhandled exceptions. You can also use Logging frameworks such as ELMAH to log all exceptions from Web API to ELMAH. You can look at a sample https://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/Elmah/ReadMe.txt
Attribute routing now supports constraints, enabling versioning and header based route selection. Many aspects of attribute routes are now customizable via the IDirectRouteProvider interface andRouteProviderAttribute class. The route prefix is now extensible via the IRoutePrefix interface and RoutePrefixAttribute class.
There's a Web API-based sample here (https://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/RoutingConstraintsSample/ReadMe.txt).
BSON media type formatter
We now support the BSON wire format both on the client and on the server assemblies. See a full sample at: https://aspnet.codeplex.com/SourceControl/latest#Samples/WebApi/BSONSample/
Support for Async filters
Web API now supports an easy way for authoring async filters. If your filter needs to access a database or do some async work, you can override the new virtual On*Async methods like the sample action filter below.
Query parsing support for the client formatting library
System.Net.Http.Formatting supported query parsing and query update for server side code, but the equivalent portable was missing this feature. In 5.1, a client application can now easily parse and update a query string.
Help Page Improvements
We have improved the Help Page feature in ASP.NET Web API so that the Help Page can provide more information such as :
For eg. if you are returning a Course resource as shown below, the Help Page will give you additional information about the Course type.
If you have any issues with ASP.NET MVC, Web API and Web Pages, please open issues on the CodePlex site (https://aspnetwebstack.codeplex.com/workitem/list/basic). For any discussions on these features please discuss them in the ASP.NET forums. For ASP.NET MVC, please see http://forums.asp.net/1146.aspx/1?MVC and Web API http://forums.asp.net/1246.aspx/1?Web+API
We also made several bug fixes as a part of this release. You can find the complete list for ASP.NET MVC, Web API and Web Pages here.
Is there any samples for Bootstrap Helpers ?
Can we have an article about how to do SEO friendly url using web.api 2.0
I'm thinking something like urls that have language parameters e.g.
and if Chinese is chosen then the language parame should be zn and in if Indian