What is ASP.NET MVC?

The ASP.NET MVC is a web development framework based on MVC pattern. It is developed by Microsoft Corporation. It is integrated with existing ASP.NET. This article represents a basic overview of Asp.net MVC, introduction to ASP.NET MVC. Summery of the article:

  • What is ASP.NET?
  • What are the Development Models in ASP.NET?
  • What is ASP.NET MVC?
  • History of ASP.NET MVC
  • Versions of ASP.NET MVC
  • Different Features of ASP.NET MVC
  • Difference between ASP.NET WebForms and ASP.NET MVC?
  • What is Routing in ASP.NET MVC?
  • What is a View Engine in ASP.NET MVC?
  • What are the Benefits of using ASP.NET MVC?

What is ASP.NET?
ASP.NET is a framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting. It follows object oriented programming approach. It is not a programming language. If we write code in note pad and run it we will get output. It is a server side technology. It uses all .NET compatible language such as C#, VB.NET, J# etc. If we write our code in any language after compilation .NET convert it into MSIL.

What are the Development Models in ASP.NET?
ASP.NET supports three different development models. Such:

  1. Web Pages– It is a Simplest ASP.NET model. It is Similar to PHP and classic ASP
  2. MVC (Model View Controller)– MVC separates web applications into 3 different components: Models for data,Views for display,Controllers for input
  3. Web Forms -The traditional ASP.NET event driven development model

 

MVC

What is ASP.NET MVC?
ASP.NET MVC is a web development framework developed by Microsoft Corporation. It is based on MVC (Model-View-Controller) architectural design pattern. ASP.NET MVC allows software developers to build application.

History of ASP.NET MVC
The first versions (ASP.NET MVC1) of ASP.NET MVC were released on 2009.

Versions of ASP.NET MVC
The different versions of ASP.NET MVC frameworks are given bellow:
ASP.NET MVC 1
ASP.NET MVC 2
ASP.NET MVC 3
ASP.NET MVC 4
ASP.NET MVC 5
ASP.NET MVC 6

Different Features of ASP.NET MVC
Microsoft ASP.NET MVC framework has different versions. Most of the versions support most of the features of old version. Every version has introduced some new features. Some features are given bellow:
ASP.NET MVC 1

  • Support core MVC features

ASP.NET MVC 2

  • Support master page
  • Support dependency injection

ASP.NET MVC 3

  • Introduce Razor as a new view engine
  • Support multiple view engine
  • Introduce template for HTML5 and CSS3
  • Improved model validation
  • Improved dependency injection and global action filters
  • Partial page output cashing
  • Support rich JavaScript with unobtrusive, jQuery Validation, and JSON binding
  • Integrated Scaffolding system extensible via NuGet

ASP.NET MVC 4

  • Introduce ASP.NET Web API
  • Introduce mobile project template
  • Introduce entry project template
  • Support windows azure SDK1.6
  • Support for adding controller to other project folder
  • Supports asynchronous controllers

ASP.NET MVC 5

  • MVC default template is replaced by Bootstrap
  • Support authentication filters for authenticating user by custom or third-party authentication provider
  • Integrated attribute routing

ASP.NET MVC 6

  • Offer single programming model
  • More optimized for cloud computing
  • Support JSON based project extension

Difference between ASP.NET WebForms and ASP.NET MVC?
The ASP.NET WebForms and ASP.NET MVC are not exactly same. Both are different. A comparison between ASP.NET WebForms and ASP.NET MVC is given bellow:
ASP.NET WebForms

  1. It uses Page controller pattern approach for rendering layout. That means every page has its own controller (code-behind page)
  2. Page size is big. Because it has large viewstate
  3. Testing is difficult.
  4. It is good for small scale of application and limited team size.

ASP.NET MVC

  1. It uses Front Controller approach. That means a common controller for all pages.
  2. Page size is small. Because, it has no viewstate.
  3. Testing is easy.
  4. It is good for large scale of application with large team size.

What is Routing in ASP.NET MVC?
In typical ASP.NET application all the incoming requests are mapped to physical files such as .aspx file. ASP.NET MVC framework uses friendly URLs that are not mapped to physical files. It uses a routing engine that maps URLs to controller. We can define our routing rules for the engine so that it can map incoming request URLs to appropriate controller.
In a browser for an ASP.NET MVC application when a user type a URL and presses “go” button, routing engine uses routing rules that are defined in Global.asax file and find out the path of corresponding controller. Routing is an excellent feature to create human friendly and Search Engine Optimized URL’s.

What is a View Engine in ASP.NET MVC?
View Engines are used to create HTML from our views to the browser.  Usually Views are a combination of HTML and different programming language. The view engine templates have different syntax for implementation. Currently there are few numbers of view engines are available for MVC. The top four view engines are ASPX, Razor, Spark and NHaml.

What are the Benefits of using ASP.NET MVC?
Microsoft ASP.NET MVC framework provides lot advantages over traditional web application development.  The benefits of ASP.NET MVC frameworks are given bellow:

  • Separation of layer. If we write our code in a class file instead of code-behind page we can reuse the same code.
  • Page size is small. Because, it has no viewstate.
  • Testing is easy. Automated UI testing is possible.

This is all about ASP.NET MVC Overview.

Comments

  1. By Kamrul

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *