First MVC 4 Application:-
This article explains about creating the MVC application and it also explains about the default templates and files included in the MVC web application project.

Step 1:Open the Visual Studio 2012 and create the new project “File-> New -> Project”

Step 2:Select the “Visual C#” with .Net Framework 4.5 and “Asp.Net MVC 4 Web Application” in New project dialog box. Specify the project name in “Name” section and click ‘Ok’

Step 3:This section allows you to select the type of project template. For now select the “Intranet Application” and click OK

Internet – This template is used to run the application in Internet and it also includes some basic account management functions which run against the ASP.NET Membership system

Intranet – It is similar to Internet application but the account management functions run against Windows accounts rather than the ASP.NET Membership system.

Basic – This template is pretty minimal. It still has the basic folders, CSS, and MVC application infrastructure in place.

Mobile application – Template is preconfigured with jQuery Mobile to jump-start creating a mobile only website. It includes mobile visual themes, a touch-optimized UI, and support for Ajax navigation

Empty – It is empty project where developer needs to add all files

Web API – ASP.NET Web API is a framework for creating HTTP services, it provides the template similar to Internet application without membership system

View engine: By default Asp.net MVC 4 application provides “Razor” view engine, you can also select the old view engine “Web Form” from the drop down list

Select the Check box if you need to create the unit test project for the web application. Addition test project will be added to your application, this will be used for Test Driven Development (TDD)

Step 4:By default visual studio comes with sample project files, so you can directly run the application without any changes.Below diagram show about the Application structure created for MVC application.

Directory Purpose
/Controllers Where you put Controller classes that handle URL requests
/Models Where you put classes that represent and manipulate data and business objects
/Views Where you put UI template files that are responsible for rendering output, such as HTML
/Scripts Where you put JavaScript library files and scripts (.js)
/Images Where you put images used in your site
/Content Where you put CSS and other site content, other than scripts and images
/Filters Where you put filter code.
/App_Data Where you store data files you want to read/write
/App_Start Where you put configuration code for features like Routing, Bundling, andWeb API

Step 5:Since you have selected ‘Intranet’ application, you need to enable the windows authentication to run the application. If you run this application without changing below step, application will throw ‘Access Denied’ error.

Select the project file and press F4 to show project properties and enable the windows authentication as mention below.

Step 6:Run the application by pressing F5 and you will see the first MVC application as mention below