ASP.NET MVC Overview:
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller.Model
- Responsible for storing and retrieving data
- Maintenance of states.
- Notification of observers of change in state.
- Classes or references including .cs and .dll files
View
- Responsible for rendering UI model.
- User interaction (Text Box, List Box, Button, Label)
- Normally hold .cshtml, .aspx pages to show output.
Controller
- Responsible for responding to user input.
- Instructing model to process the user input.
- Make a bridge between view and model.
Every controller holds one or more than one action method(s). These action methods are calling during the execution through URL like let’s say the URL is localhost/Home/Index.
Here Home is the controller name and Index is the ActionMethod name. Now every Action method has its own View by its name. So here a view will be stored within the View à Home folder namedIndex.cshtml.
Whenever you will request for Home/Index the index.cshtml file will be shown within that View àHome folder
Here Home is the controller name and Index is the ActionMethod name. Now every Action method has its own View by its name. So here a view will be stored within the View à Home folder namedIndex.cshtml.
Whenever you will request for Home/Index the index.cshtml file will be shown within that View àHome folder
Now let’s see how to start this. Open your Visual Studio 2013 Choose project and set your name like as shown below
Now open your solution explorer in that we have three folders named Model, Controller and View and it will contain two web.config in solution one in the root folder and another one in the View folder.
OK now let’s start with a simple program. Right click on the Controller folder and choose Create new Controller. Name it HomeController.

No comments:
Post a Comment