Step 1
Create project
- Open Visual Studio 2015-> click File -> New-> Project.

- Visual C#-> Web -> ASP.NET Web Application-> write Project Name-> OK.

- Select MVC template. Empty-> Click MVC Folder-> OK.

- MVC Folders are created.

Let's understand MVC architecture in ASP.NET
MVC stands for Model, View and Controller. MVC separates an application into three components - Model, View and Controller.
Model
Model represents the shape of the data and business logic. It maintains the data of the Application. Model objects retrieve and store model state in a database.
View
View is a user interface. View displays the data, using model, to the user and also enables them to modify the data.
Controller
Controller handles the user request.
The flow of the user's request in ASP.NET MVC is given below.

- First user enters a URL in the Browser (www.google.com)
- It goes to the Server and calls an appropriate controller.
- The Controller uses the appropriate View and Model, creates the response and sends it back to the user.
- Controller handles the user's requests, so first we have to create a Controller
Step 2
Add Controller
- Go to the controllers folder-> Add-> Controller-> Select MVC 5 Controller Empty->Add.

- It will open Add Controller dialog, as shown below.

- Write Controller Name. Do not delete the word Controller. Remember, controller name must end with Controller.

- This will create HomeController class with Index method in HomeController.cs file under Controllers folder, as shown below.






Sarath MayaPosted Jan 31, 2017, 9:46 AM
Thanks for Posting..i did it