11
OctA Brief History of ASP.NET MVC Framework
ASP.NET MVC Framework: An Overview
ASP.NET MVC is a new framework built on top of Microsoft .Net Framework to develop the web application. This framework implements the MVC pattern which helps to provide separation of code and also provides better support for test-driven development (TDD).Asp.Net MVC is a lightweight and highly testable open-source framework for building highly scalable and well-designed web applications. Here is the list of the released version history of ASP.NET MVC Framework with their features. In this MVC Tutorial, we will explore more about the MVC Framework which will include the asp.net MVC release history, and asp.net MVC history, comparing various asp.net MVC versions and Features of the ASP.NET MVC Framework.
What is the ASP.Net MVC Framework
Basically, MVC is a framework methodology that divides an application's implementation into three component roles: models, views, and controllers. Hence in Asp.net MVC, you need to play with controllers, actions, and views.
MVC Pattern
The Model-View-Controller (MVC) pattern is an adaptation of a pattern generated from the Smalltalk community in the 1970s by Trygve Reenskaug. It was popularized for use on the web with the advent of Ruby on Rails in 2003.
- Model
- View
- Controller
Let's see one by one,
- Model
Models in an MVC-based application are the components of the application that are responsible for maintaining the state. Often this state is persisted inside a database for example: we might have a Product class that is used to represent order data from the Products table inside SQL.
- View
Views in an MVC-based application are the components responsible for displaying the application's user interface. Typically this UI is created off of the model data for example: we might create a Product "Edit" view that surfaces textboxes, dropdowns, and checkboxes based on the current state of a Product object.
- Controller
Controllers in an MVC-based application are the components responsible for handling end-user interaction, manipulating the model, and ultimately choosing a view to render to display UI. In an MVC application, the view is only about displaying information - it is the controller that handles and responds to user input and interaction.
Asp.net MVC history
- ASP.NET is a free framework for developing websites and web applications on .NET Framework using HTML, CSS, and JavaScript.
- It is a web framework based on Model-View-Controller (MVC) architecture.
- ASP.NET MVC was introduced in .NET 3.5, and since then lots of new features have been added.
- It is introduced by Microsoft.
- Microsoft made this framework open-source in April 2009 and The source code was released under the Microsoft Public License (MS-PL)
MVC framework version comparison
Asp.Net MVC1
Released on Mar 13, 2009
Runs on .Net 3.5 and with Visual Studio 2008 & Visual Studio 2008 SP1
MVC Pattern architecture with WebForm Engine
Html Helpers
Ajax helpers
Routing
Unit Testing
Asp.Net MVC2
Released on Mar 10, 2010
Runs on .Net 3.5, 4.0 and with Visual Studio 2008 & 2010
Strongly typed HTML helpers mean lambda expression HTML Helpers
Templated Helpers
Support for Data Annotations Attribute
Client-side validation
UI helpers with automatic scaffolding & customizable templates
Attribute-based model validation on both client and server
Overriding the HTTP Method Verb including GET, PUT, POST, and DELETE
Areas for partitioning large applications into modules
Asynchronous controllers
Asp.Net MVC3
Released on Jan 13, 2011
Runs on .Net 4.0 and with Visual Studio 2010
The Razor View engine
Improved Support for Data Annotations
Remote Validation
Compare Attribute
Sessionless Controller
Child Action Output Caching
Dependency Resolver
Entity Framework Code First support
Partial-page output caching
ViewBag dynamic property for passing data from controller to view
Global Action Filters
Better JavaScript support with unobtrusive JavaScript, jQuery Validation, and JSON binding
Use of NuGet to deliver software and manage dependencies throughout the platform
Good Intellisense support for Razor in Visual Studio
Asp.Net MVC4
Released on Aug 15, 2012
Runs on .Net 4.0, 4.5 and with Visual Studio 2010SP1 & Visual Studio 2012
ASP.NET Web API
Enhancements to default project templates
Mobile project template using jQuery Mobile
Display Modes
Task support for Asynchronous Controllers
Bundling and minification
Support for the Windows Azure SDK
Asp.Net MVC5
Released on 17 October 2013
Runs on .Net 4.5, 4.5.1 and with Visual Studio 2013
One Asp.Net
Asp.Net Identity
ASP.NET Scaffolding
Authentication filters - run prior to authorization filters in the ASP.NET MVC pipeline
Bootstrap in the MVC template
ASP.NET Web API2
The asp.net MVC release history:
Features of the ASP.NET MVC Framework.
1. Attribute Routing
- The major difference between ASP.NET MVC and ASP.NET web forms is the way incoming requests are handled.
- MVC routing pattern maps URLs with action methods,
- To see where routes are configured, First go to the solution explorer of ASP.NET MVC application find the App_Start folder, and find the RouteConfig.cs file.
- It contains a method named RegisterRoutes.
- Inside this RegisterRoutes method are routes that are to be ignored,routes that are to be added can be defined. This is shown in the following code snippet:
public static void RegisterRoutes(RouteCollection routes){ routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Option } ); }
- Apart from defining routes in the RouteConfig.cs file, ASP.NET MVC 5 has introduced a new feature.
- This new feature is called attribute routing which allows developers to specify a route as an attribute of the action method.
- To enable attribute routing, we need to modify the RegisterRoutes method of the RouteConfig.cs file as follows:
public static void RegisterRoutes(RouteCollection routes) { routes.MapMvcAttributeRoutes(); }