ASP.NET MVC 5 – is it worth the trouble of an upgrade?

Microsoft’s ASP.NET MVC 5 promises a number of tantalising new features over its predecessors. These include: attribute-based routing, filter overrides, native support of Twitter’s Bootstrap code for CSS and HTML5 enabled sites, simple integration to work across multiple frameworks and easier authentication.

Let’s go through the enhancements and improvements included in the update in a little more detail.

Attribute-based Routing

One of the most exciting new features of Microsoft’s MVC 5 is a new routing feature called attribute-based routing.

The earlier style of routing used in previous versions, called convention-based routing, can leave developers scratching their heads trying to understand the application’s relationships as the routes are separated from the controllers they apply to. However, as its name suggests, attribute-based routing uses attributes to define routes and gives developers more control over the URIs in the web application.

Filter Overrides

This snazzy new feature does away with one of a Visual Studio developer’s biggest headaches. Filter Overrides allow a developer to replace or completely clear certain filter types that are created at higher scopes in one fell swoop.

Now if a developer wants to override a global action filter in one of the action method’s then they just need to apply the “OverrideActionFilters” attribute. In previous versions of .NET MVC, in order to override a global action filter or a global controller filter, a developer had to painstakingly apply a filter for each action and controller, one by one. Filter Overrides do way with this completely.

Bootstrap

Twitter Bootstrap has been added to Visual Studio 2013 as the default user interface framework for an MVC application.

Bootstrap is a clever beast which is comprised of a free collection of HTML and CSS design templates developed over at Twitter. It can easily be downloaded here http://getbootstrap.com and the framework is increasingly popular with software developers as it cuts down on development time and produces a set of clear and consistently designed websites.

The framework means developers can rapidly design form elements, navigation bars, tables, buttons and other generic elements needed for a responsive user interface. All without having to rehash the same code used across multiple sites, which just reinvents the wheel and wastes precious development time.

Bootstrap also promotes responsive website design as the page’s layout will automatically adjust with the browser’s width. In other words, Bootstrap optimises the page for mobile browsing, which is a key piece of design functionality for any modern website.

Also included in the Bootstrap package is the bootstrapper.js file. This contains plenty of useful jQuery code to provide interactive plug-ins and components in a single file.

In short, the native support of the Bootstrap library gives developers a massive boost to their application’s arsenal, giving them a wider range of multi-platform HTML5 and CSS options than ever offered before.

Scaffolding

Bootstrap isn’t the only framework included in Visual Studio 2013; there is also the new Scaffolding Framework provided for ASP.NET Web Applications.

Adding Scaffolding to a project lets a developer quickly add code that interacts with data models. Using Scaffolding also reduces the amount of time to develop standard data operations in the MVC application. Any framework that reduces development time is sure to get a big thumbs up from the development community.

Improved Authentication

Microsoft has improved authentication for ASP.NET MVC 5 by including third party authentication and improving ASP.NET Identity.

An ASP.NET MVC 5 application can now be accessed by developers logging in using an external authentication provider, like Google. So developers can simply use their Gmail address and password to log in to the application, and the application only demands permissions to view their email address and basic account information.

Next up, we have ASP.NET Identity. True, this is not strictly a “new” feature, but it has been improved to give users a single sign on across frameworks such as Web Forms, MVC, Web Pages and so forth.

One ASP.NET

Another new feature is One ASP.NET, which is a unified project system for .NET software developers.

Working with multiple frameworks in a single project is made significantly easier using One ASP.NET, allowing software developers to combine Web Forms, MVC, Web API and other frameworks together in a single project.

This feature means developers no longer need to pick a single technology at the start of a project and stick with it. Instead, One ASP.NET encourages developers to use multiple ASP.NET frameworks within one project.

To conclude, ASP.NET MVC 5 is a more than worthy update as it enables developers to build dynamic websites with an emphasis on clean architecture, extensibility and test-driven development.

Contact Us, to learn more about how we could help you implement ASP.NET MVC in your website.

Share Pin it