Introduction to ASP.NET MVC

What is MVC?

MVC stands for Model View Controller. It is one of the design pattern for develop the website and web application. It was introduced by Trygve Reenskaug into Smalltalk-76 while visiting Xerox Parc in the 1970s. Now this pattern successfully use by many programming language like .Net (Asp.Net MVC), Java (Spring), Ruby (Rail), Django (Python). In .Net, MVC was introduced in 10 December 2007 (named as ASP.NET MVC CTP).

In .NET, various versions of MVC versions are introduced from the version 1.0 to 6.0. We will see the features of each version.

MVC 1:

  • MVC Pattern architecture with Web Form Engine.
  • Html Helpers for html controls.
  • Ajax helpers to update the part of the page.
  • Routing the URL.
  • Unit testing project introduced.

MVC 2:

  • Introduced strongly typed view.
  • The Data annotations attribute introduced.
  • Support to client side validations.

MVC 3:

  • Template for HTML5 and CSS3 introduced.
  • The model validation improved.
  • The Razor engine introduced.
  • Improved controller.
  • Unobtrusive java script approach introduced.
  • Dependency injection improved.
  • Partial page output caching.

MVC 4:

  • Asp.Net Web API introduced.
  • Improved look and feel.
  • Empty project template introduced.
  • Task support for Asyn controller.
  • Bundling and Minification was introduced.
  • Support for windows azure.

MVC 5:

  • ASP.NET identity introduced.
  • The authentication filters introduced.
  • Boostrap introduced for responsive design.
  • Attribute routing introduced.

MVC 6

  • Open Source and supports running on multiple platforms including Linux and Mac.
  • New JSON-based project Extension.
  • In order to dynamically compile code, Roslyn compiler is used.
  • Single Programming Model for both ASP.NET MVC and ASP.NET Web API.
  • Optimized for Cloud Computing.

Why MVC recommended in ASP.NET?

  • Test driven approach: The test driven approach is facilitated much more easily.
  • Separation of concern: It is encouraged and easier to implement. It will support for rapid application development.
  • Support for multiple forms: Web forms do not allow for multiple forms on a page, whereas MVC allows for any number of forms on the page.