What is ASP.NET MVC?
ASP.NET MVC is a Microsoft implementation of Model View Controller pattern with ASP.NET technology. ASP.NET MVC is a part of ASP.NET Web Application Framework. You can create ASP.NET Web Application in two ways. One way is to create an ASP.NET Web form, which is an event-driven programming. Another way of creating the application is through ASP.NET MVC where we will have Model, View and Controller as three separate layers to create web application. To understand these layers lets understand “Model View Controller” first in details.
What is Model, View and Controller pattern?
Model, View and Controller patterns are based on three aspects of the application input logic where we have entities (database) as Model. View is related to UI. All UI comes under View. Controller is the place where we are going to write the business logic. MVC pattern does have a long history. The MVC pattern was invented by Trygve Reenkaug when he was the Visiting Scientist at smalltalk group.
Scott Guthrie and his team members originally created the Microsoft ASP.NET MVC framework. Following is a basic diagram to see how it works.
As you can see in the above diagram, ASP.NET MVC and ASP.NET webforms are different platform based on ASP.NET Framework. At bottom, there is Microsoft.NET framework. Therefore, it just a different way of doing programming but it uses same framework that ASP.NET Webforms are using.
Architecture of Microsoft ASP.NET MVC Framework:
Like any other Model View Controller pattern, ASP.NET MVC Framework is divided into three parts.
- Model: A Model contains logic for database access, business logic and validation logic, which is needed for the application. It will not be a part of View and Controller section.
- Controller: Controller is the middle tier between Model and View. It contains the actions, which View will perform when user interacts with UI of application. This action calls model classes and get response from model classes informs of data, JSON etc.
Following diagram will express the flow of ASP.NET MVC
How to install ASP.NET MVC Framework :
Here we are going to use ASP.NET MVC 3. First, you have to download installer from ASP.NET MVC 3.0 from the following link.
It contains three options from where we need to download ASPNETMVCTools update just like following which I have highlighted.
After downloading this setup once, you double click this, it will load above screen.
Once you accept license terms and click install it will start installation as shown in the screen below.
Once installation is completed, the following screen will be loaded.
That is it. You are now ready to use ASP.NET MVC 3.0. Hope you like this. In our next chapter, we will write out first application of ASP.NET MVC 3.0.