Krishan Dutt Sharma

Web Developer

ASP.NET MVC Application Folder Structure

In This Article we learn, How to Create a demo MVC Project using Visual Studio 2013 Community Edition. So, Friends lets Start with the creation of new Project.

Create New Project in Visual Studio 2013 which  we learn our previous article “Create A New ASP.NET MVC Project In Visual Studio 2013”

ASP.NET MVC Folder Structure

It is very important to Know about the folder Structure of MVC. It will help you to add files to an appropriate folder.

Visual Studio creates the following folder structure of MVC application by default.

  1. App_Data: In MVC Folder Structure First Folder is App_Data which contains data files like LocalDB, .mdf Files, XML files and other data related files. IIS will never serve files from App_data Folder.
  2. App_Start: In MVC Folder Structure the second Folder is App_Start which Contains class files which get executed when the application starts. Normally it is config files like BundleConfig.cs, AuthConfig.cs, Filterconfig.cs etc.
  3. Content:  In MVC Folder Structure the third Folder is Content which Contains static files like CSS Files, Images and icons etc. MVC 5 Application include bootstrap.cs bootstrap.min.cs and site.css by default.
  4. Controllers: In MVC Folder Structure the fouth Folder is Controllers which Contains class files which handle user’s request and response. All the controller file name end with Controller word like EntryController, LoginController etc. You will Learn about the Controller in Next Section.
  5. Fonts: In MVC Folder Structure the fifth Folder is Fonts which contains custom font files for your application.
  6. Model: In MVC Folder Structure the sixth Folder is Model which Contains model class file which handles database tasks. Typically model class includes public properties, which will be used by the application to hold and manipulate application data.
  7. Scripts: In MVC Folder Structure the seventh Folder is Scripts which contains scripts file slike JavaScripts, VBScript, JQuery etc. MVC 5 Include javascript files for bootstrap, jquery1.XX and modernizer by default.
  8. View:  In MVC Folder Structure the eighth  Folder is View which  Contains HTML Files. There May be a Separate folder for each controller. For EntryController.cs; there is Entry Folder inside View Folder. Typically view files is a .cshtml file where you write HTML and c# or code.
  9. Shared:  In MVC Folder Structure the second ninth is Shared which is under view folder and it contains shared files like master page layout etc. Shared folder content can be accessed by any Controller.
  10. Global.asax: In MVC Folder Structure the tenth File is Global.asax which allows you to write code that runs in response to application level events, such as  Application_BeginRequest, Application_start, Application_error, Session_start, Session_end etc.
  11. Package.config:  In MVC Folder Structure the eleventh file is Package.config which is managed by NuGet to keep track of what packages and versions you have installed in the application.
  12. Web.config: In MVC Folder Structure the twelfth file is web.config which contains application level configurations.

If I have missed anything, please comment below.