Let us go ahead and see how to create and run a very basic MVC Application.
Step 1: Go to Visual Studio, FILE, New, then click Project. It will open a popup.

Step 2: Select Web from the left hand pane. On the right hand side Select ASP.NET MVC 4 Web Application.

Step 3: Select Empty template as we do not want pre generated code and class files as of now. We will be using Razor Engine so it is auto selected and need not be changed. Click OK.

Visual Studio creates the following folders under MVC project. Let us see the contents generated by the Visual Studio in the application.

We get three folders named Model, View and controller. Since in MVC the user interacts with a controller so let us now add a controller to the application. Right Click on Controllers folder-> Go to Add-> Select Controllers.

The following popup appears next. We will name our controller here. Name it “Home”. Controller keyword is auto appended. So it is recommended not to remove it from the textbox. We would be selecting Empty MVC controller as the template.

Following is the content in the controller we just created.
- using System;
- usingSystem.Collections.Generic;
- usingSystem.Linq;
- usingSystem.Web;
- usingSystem.Web.Mvc;
- namespaceMyFirstMVCApp.Controllers
- {
- public class HomeController: Controller
- {
- //
- // GET: /Home/
- publicActionResult Index()
- {
- return View();
- }
- }
- }








Ravi KandelPosted Jul 14, 2016, 12:10 PM
Thanks for sharing.
Ravi KandelPosted Jul 14, 2016, 12:10 PM
Thanks for sharing.
Vikki KumarPosted May 23, 2016, 1:04 AM
Nice Articles Sir
NitinPosted May 20, 2016, 11:42 PM
Thanks @Debasis
Debasis SahaPosted May 20, 2016, 10:53 AM
Nice One..
Pradeep SahooPosted May 20, 2016, 7:08 AM
Nice share....
Sonu ChaudharyPosted May 19, 2016, 11:36 AM
good one
Thiruppathi RPosted May 18, 2016, 2:36 AM
Good..
Neeraj KumarPosted May 17, 2016, 2:51 PM
Nice article
Bhuvanesh MohankumarPosted May 17, 2016, 2:21 PM
Good one
sreenivasa kPosted May 17, 2016, 12:26 PM
good
Kuppurasu NagarajPosted May 17, 2016, 10:57 AM
Nice sharing..