Introduction

Today, Microsoft’s  ASP.NET MVC framework has become a robust framework for building highly scalable, maintainable  enterprise web applications.  I am just taking you through the journey of ASP.NET MVC since 2009 and where we are today.

ASP.NET MVC is a free, fully supported Microsoft framework for developing great web applications using the Model-View-Controller pattern. It provides total control over your HTML and URLs, enables rich Ajax integration, and facilitates test driven development.

ASP.NET MVC source code is published as open source under the Codeplex umbrella and MS-PL license at the codeplex location http://aspnet.codeplex.com/

Journey of ASP.NET MVC

ASP.NET MVC provides a new Model-View-Controller (MVC) framework on top of the existing ASP.NET runtime. This means that developers can take advantage of the MVC design patterns to create their Web Applications which includes the ability to achieve and maintain a clear separation of concerns (the UI or view from the business and application logic and backend data), as well as facilitate test driven development (TDD).

The ASP.NET MVC framework defines a specific pattern to the Web Application folder structure and provides a controller base-class to handle and process requests for “actions”.

Developers can take advantage of the specific Visual Studio MVC templates within this release to create their Web applications, which includes the ability to select a specific Unit Test structure to accompany their Web Application development.

The MVC framework is fully extensible at all points, allowing developers to create sophisticated structures that meet their needs, including for example Dependency Injection (DI) techniques, new view rendering engines or specialized controllers.

Let’s go through the different versions and what features been introduced in each release.

ASP.NET MVC 1.0  – Released – 13 March 2009

Target Framework & IDE:  .NET Framework 3.5  and Visual Studio 2008 SP1

Since it is the initial release – it had few limitations which were overcome in later releases. But it helped us to build robust web applications with Test Driven Development.

This release included the following features:

  • Visual Studio Tooling Improvements to Add View, Controller and Model.
  • MVC Project teamplates for Visual Studio 2008 SP1.
  • jQuery was officially bundled with the Project template.
  • MVC ASPX view engine syntax highlighting
  • Partial jQuery syntax highlighting (requires jquery-vsdoc.js library to be in Scripts/JS folder).
  • Scaffolding support for creating basic Edit, Create, List, Delete and Details views.
  • Custom Scaffolding support.
  • Custom View Engine support.
  • Highly extensible.
  • Strongly typed HTML and AJAX helpers.
  • Form Post improvements.
  • Model Binder API.
  • Cross Site Request Forgery (CSRF) Protection.
  • FileResult and File() helper method.
  • File Uploading Support.
  • JavaScriptResult ActionResult and JavaScript() helper method.
  • Request.IsAjaxRequest Property.

Ref: http://go.microsoft.com/fwlink/?LinkID=137661&clcid=0x409

Download ASP.NET MVC 1.0 RTM

 ASP.NET MVC 2.0  – Released – 10 March 2010

Target Framework & IDE:  .NET Framework 3.5 SP1, 4.0 and Visual Studio 2008 SP1 & 2010

 What’s New in ASP.NET MVC 2.0

  • Templated Helpers
  • Areas –  For more information, see Walkthrough: Organizing an ASP.NET MVC Application by Areas on the MSDN Web site.
  • Support for Asynchronous Controllers
  • Support for DefaultValueAttribute in Action-Method Parameters
  • Support for Binding Binary Data with Model Binders
  • ModelMetadata and ModelMetadataProvider Classes
  • Support for DataAnnotations Attributes
  • Model-Validator Providers
  • Client-Side Validation
  • New Code Snippets for Visual Studio 2010
  • New RequireHttpsAttribute Action Filter
  • Overriding the HTTP Method Verb
  • New HiddenInputAttribute Class for Templated Helpers
  • Html.ValidationSummary Helper Method Can Display Model-Level Errors.
  • T4 Templates in Visual Studio Generate Code that is Specific to the Target Version of the .NET Framework.
  • API Improvements

For more details information on What’s new in ASP.NET MVC 2 visit http://www.asp.net/whitepapers/what-is-new-in-aspnet-mvc

Download ASP.NET MVC 2 RTM

ASP.NET MVC 3.0 – Released – 13 January 2011

Target Framework & IDE: 4.0 and Visual Studio 2010 SP1, 2012

What’s New in ASP.NET MVC 3.0

  • New Razor View Engine, more simple syntax for view development. Razor syntax is clean and concise, requiring a minimum number of keystrokes.
  • Extensible Scaffolding with MvcScaffold integration.
  • HTML 5 Project Templates.
  • Support for Multiple View Engines.
  • Controller Improvements
  • Global Action Filters
  • New ViewBag property
  • New “ActionResult” Types
    • HttpNotFoundResult. Returns a 404 HTTP status code to the client.
    • RedirectResult. Returns a temporary redirect (HTTP 302 status code) or a permanent redirect (HTTP 301 status code), depending on a Boolean parameter. In conjunction with this change, the Controller class now has three methods for performing permanent redirects: RedirectPermanent, RedirectToRoutePermanent, and RedirectToActionPermanent. These methods return an instance of RedirectResult with the Permanent property set to true.
    • HttpStatusCodeResult. Returns a user-specified HTTP status code.
  • JavaScript and Ajax Improvements
  • Client-Side Validation Enabled by Default
  • Remote Validator –  This enables the client-side validation library to automatically call a custom method that you define on the server in order to perform validation logic that can only be done server-side.
  • JSON Binding Support
  • Model Validation Improvements
    • “DataAnnotations” Metadata Attributes.
    • “ValidationAttribute” Class
    • Validation Interfaces
  • Dependency Injection Improvements

ASP.NET MVC 3 introduces a new concept called a dependency resolver, which greatly simplifies the use of dependency injection in your applications. This makes it easier to decouple application components, which makes them more configurable and easier to test.

Support has been added for the following scenarios:

  • Controllers (registering and injecting controller factories, injecting controllers)
  • Views (registering and injecting view engines, injecting dependencies into view pages)
  • Action filters (locating and injecting filters)
  • Model binders (registering and injecting)
  • Model validation providers (registering and injecting)
  • Model metadata providers (registering and injecting)
  • Value providers (registering and injecting).
  • Other New Features
    • NuGet Integration
    • Partial-Page Output Caching
    • Granular Control over Request Validation
    • Extensible “New Project” Dialog Box
    • Template Scaffolding Improvements
    • New Overloads for “Html.LabelFor” and “Html.LabelForModel”
    • Sessionless Controller Support
    • New “AdditionalMetadataAttribute” Class.
    • AccountController improvements
    • New Intranet Project Template

 

For more details information on What’s new in ASP.NET MVC 3 – visit http://www.asp.net/mvc/mvc3

Download MVC 3.0 RTM and ASP.NET MVC 3 Tools Update

ASP.NET MVC 4.0 – Released – 15 Aug 2012

Target Framework & IDE: 4.0, 4.5 and Visual studio 2010 SP1, 2012

 Top Features

  • ASP.NET Web API
  • Refreshed and modernized default project templates
  • New mobile project template
  • Many new features to support mobile apps
  • Enhanced support for asynchronous methods

 

What’s New in ASP.NET MVC 4

  • ASP.NET Web API

ASP.NET Web API includes support for the following features:

  • Modern HTTP programming model: Directly access and manipulate HTTP requests and responses in your Web APIs using a new, strongly typed HTTP object model. The same programming model and HTTP pipeline is symmetrically available on the client through the new HttpClient type.
  • Full support for routes: ASP.NET Web API supports the full set of route capabilities of ASP.NET Routing, including route parameters and constraints. Additionally, use simple conventions to map actions to HTTP methods.
  • Content negotiation: The client and server can work together to determine the right format for data being returned from a web API. ASP.NET Web API provides default support for XML, JSON, and Form URL-encoded formats and you can extend this support by adding your own formatters, or even replace the default content negotiation strategy.
  • Model binding and validation: Model binders provide an easy way to extract data from various parts of an HTTP request and convert those message parts into .NET objects which can be used by the Web API actions. Validation is also performed on action parameters based on data annotations.
  • Filters: ASP.NET Web API supports filters including well-known filters such as the [Authorize] attribute. You can author and plug in your own filters for actions, authorization and exception handling.
  • Query composition: Use the [Queryable] filter attribute on an action that returns IQueryable to enable support for querying your web API via the OData query conventions.
  • Improved testability: Rather than setting HTTP details in static context objects, web API actions work with instances of HttpRequestMessage and HttpResponseMessage. Create a unit test project along with your Web API project to get started quickly writing unit tests for your Web API functionality.
  • Code-based configuration: ASP.NET Web API configuration is accomplished solely through code, leaving your config files clean. Use the provide service locator pattern to configure extensibility points.
  • Improved support for Inversion of Control (IoC) containers: ASP.NET Web API provides great support for IoC containers through an improved dependency resolver abstraction
  • Self-host: Web APIs can be hosted in your own process in addition to IIS while still using the full power of routes and other features of Web API.
  • Create custom help and test pages: You now can easily build custom help and test pages for your web APIs by using the new IApiExplorer service to get a complete runtime description of your web APIs.
  • Monitoring and diagnostics: ASP.NET Web API now provides light weight tracing infrastructure that makes it easy to integrate with existing logging solutions such as System.Diagnostics, ETW and third party logging frameworks. You can enable tracing by providing an ITraceWriter implementation and adding it to your web API configuration.
  • Link generation: Use the ASP.NET Web API UrlHelper to generate links to related resources in the same application.
  • Web API project template: Select the new Web API project form the New MVC 4 Project wizard to quickly get up and running with ASP.NET Web API.
  • Scaffolding: Use the Add Controller dialog to quickly scaffold a web API controller based on an Entity Framework based model type.

For more details on ASP.NET Web API please visit http://www.asp.net/web-api.

  • Enhancements to Default Project Templates
  • Mobile Project Template
  • Display Modes
  • jQuery Mobile, the View Switcher, and Browser Overriding
  • Task Support for Asynchronous Controllers
  • Azure SDK
  • Database Migrations
  • Empty Project Template
  • Add Controller to any project folder
  • Bundling and Minification
  • Enabling Logins from Facebook and Other Sites Using OAuth and OpenID

For more details information on What’s new in ASP.NET MVC 4 – visit http://www.asp.net/whitepapers/mvc4-release-notes

Download ASP.NET MVC 4.0 RTM

Conclusion:
ASP.NET MVC is an excellent web application development framework with lots of potential for extensibility. For developing large enterprise applications and you are looking for Test Driven Development and maintainability of the source code – ASP.NET MVC is the best choice.

You can go through the given reference links below for additional information. http://www.asp.net/mvc site contains lots of interesting videos and tutorials that may interest in your learning.

References:

http://www.asp.net/mvc

http://www.asp.net/web-api

http://www.asp.net/whitepapers/what-is-new-in-aspnet-mvc

http://www.asp.net/mvc/mvc3

http://www.asp.net/whitepapers/mvc4-release-notes

Wrox Professional ASP.NET MVC 3