Home »  Dot Net MVC Tutorial »  Folder Structure In MVC

Folder Structure In MVC

Folder Structure In MVC

MVC Folder structure in Solution Explorer

MVC Folder structure

App_Data folder :

App_Data folder contains application data files including .mdf database files, XML files, and other data store files.

App_Start folder :

App_Start folder has been introduced in MVC4. It contains various configurations files like as BundleConfig.cs, FilterConfig.cs, RouteConfig.cs, WebApiConfig.cs for your application. All these settings are registered within Application_Start method of Global.asax.cs file.

  • BundleConfig.cs This is used to create and register bundles for CSS and JS files. By default, various bundles are added in this files including jQuery, jQueryUI, jQuery validation, Modernizr, and Site CSS.
  • FIlterConfig.cs This is used to register global MVC filters like error filters, actions filters etc. By default it contains HandleErrorAttribute filter.
  • RouteConfig.cs This is used to register various route patterns for your ASP.NET MVC application. By default, one route is registered here named as Default Route.
  • WebApiConfig.cs This is used to register various WEB API routes like as ASP.NET MVC, as well as set any additional WEB API configuration settings.

Content folder:

Content folder contains static files like css files, images and icons files. By default MVC 5 application includes bootstrap.css, bootstrap.min.css and Site.css.

Controllers folder:

Controllers folder contains class files for the controllers. The MVC framework requires the names of all controllers to end with "Controller", such as HomeController, LoginController, or ProductController.

Fonts folder:

Fonts folder contains custom font files for application.

Models folder:

Models folder contains model class files. Typically model class includes public properties, which will be used by application to hold and manipulate application data.

Scripts folder:

Scripts folder contains JavaScript or VBScript files for the application. By default MVC includes javascript files for bootstrap, jquery 1.10 and modernizer.

Views folder:

Views folder contains html files for the application. Typically view file is a .cshtml file where you write html and C# or VB.NET code.Views folder includes separate folder for each controllers. For example, all the .cshtml files, which will be rendered by HomeController will be in View > Home folder.Shared folder under View folder contains all the views which will be shared among different controllers e.g. layout files

Global.asax file:

Global.asax 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.

Packages.config file:

Packages.config file is managed by NuGet to keep track of what packages and versions you have installed in the application.

Web.config file:

Web.config file contains application level configurations.

Contact Us| About Us| Terms| Privacy Policies
Powered by Lorquins Technologies© 2017 QuickToStudy.com. All Rights Reserved