Professional Documents
Culture Documents
Model: View Only Displays Information Whereas The Controller Handles and Responds To The User Input and Requests
Model: View Only Displays Information Whereas The Controller Handles and Responds To The User Input and Requests
1. Model
2. View
3. Controller
Model
Model: Model is a part of the application which implements the logic for the data domain of the application. It is used to
retrieve and store model state in a database such as SQL Server database. It also used for business logic separation from
the data in the application.
Or
Model: Model represents the shape of the data. A class in C# is used to describe a model. Model
objects store data retrieved from the database.
View
View: View is a component that forms the application's user interface. It is uses to create web pages
for the application. An example would be an edit view of a Products table that displays text boxes,
drop-down lists and check boxes based on the current state of a Product object.
or
View: View in MVC is a user interface. View display model data to the user and also enables them
to modify them. View in ASP.NET MVC is HTML, CSS, and some special syntax (Razor syntax) that
makes it easy to communicate with the model and the controller.
Controller
Or
This design pattern is a lightweight framework which is integrated with various features such as master pages and
membership based authentication. It is defined in the System.Web.Mvc assembly.
or
Controller: The controller handles the user request. Typically, the user uses the view and raises
an HTTP request, which will be handled by the controller. The controller processes the request and
returns the appropriate view as a response.
The following figure illustrates the interaction between Model, View, and Controller.
MVC Architecture
The following figure illustrates the flow of the user's request in ASP.NET MVC.
Points to Remember
MVC 4.0 VS 2010 SP1, .NET 4.0/4.5 15-Aug-2012 Mobile project template
VS 2012 Bundling and minification
Support for Windows Azure SDK
o It manages application complexity by dividing an application into the model, view and controller.
o It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want
full control over the behavior of an application.
o It provides better support for test-driven development.
o It provides high degree of control to the developer over the application behavior.
Click on file menu from the menu bar and select new submenu to create a new project. The following image show
that how to create a new project.
2. Select Project Type
Here, select type of project as a web project and provide name of the project.
After selecting project type, now select the web template that we want to implement. Since we are working on
MVC then select MVC template from the list of available template. At the same time, provide the authentication
type to the application.
After clicking ok, it creates a project that has following structure:
2.Refernces = The Location where we add and config the refrence that are
required for our application