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 asp.net mvc 4 application. This will include the steps to create asp.net mvc 4 application as well as the default project structure.

After you installed asp.net 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 asp.net mvc 4 application.

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

App_Data:
This directory can contain database file, XML file etc.

App_Start:
This directory contains some config .cs files.

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

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

Models:
This contains the classes for Model in asp.net application.

Scripts:
This directory is used to store JavaScript and jQuery files.

Views:
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"