Follow in Twitter & Facebook

Like in Facebook

Powered By Blogger Widgets

Free Download

FREE Tools

Sunday, August 19, 2012

First Asp.Net MVC 4 application

In this article we will discuss about our first demo mvc 4 application. This will include the steps to create mvc 4 application as well as the default project structure.

After you installed mvc 4, Open Visual Studio 2010 then go to File -> New -> Project.

This will open the New Project dialog box, from there select ASP.NET MVC 4 Web Application and give a name and set the location and click on OK as shown in the figure below. Remember the Target framework should be selected as .Net Framework 4.

After that New Asp.Net MVC 4 project template dialog box will open. From there we can select the project template what ever we want, here I have selected Internet Application. Also you can select view engine and If you want to create a Test project then check the checkbox Create a unit test project and click on OK. [Refer figure below:]

This finished the 1st part of the article that is creating first demo mvc 4 application.

Project Structure:
The Asp.Net MVC 4 project structure will look like the figure:

This directory can contain database file, XML file etc.

This directory contains some config .cs files.

This directory usually store images, css files. Site.css file is the default css file used in mvc 4 application.

This directory is the container for controller .cs classes. By default, this directory contains two controllers: HomeController and AccountController.

This contains the classes for Model in application.

This directory is used to store JavaScript and jQuery files.

The Views directory contains the templates used to render your user interface.

Apart from that the project also contains an Web.config and Global.asax.cs file.

Now you can start the application by using Ctrl + F5.

0 on: "First Asp.Net MVC 4 application"