Tuesday, 17 January 2017

ASP.NET MVC Folder Structure

Understanding ASP.NET MVC Folder Structure

Remember points
  1. Each controller name ends with suffix controller.
  2. The single view directory can be used for entire application.
  3. By default all directories (folder) created with name of controller name.

Let us learn about major folders in brief as in the following:
  1. App_Data
  2. App_Start
  3. fonts
  4. Content
  5. Controllers
  6. Models
  8. Script

1:- App_Data
This folder is used to store file based database such as SQL Server .mdf files or xml files, etc as in the following image.
2:- App_Start
This folder contains some core configuration files that is applicable for entire MVC application.
Normally it contains the following files:
  1. BundleConfig.cs - Contains Bundling related registration.
  2. IdentityConfig.cs - Contains Identity related stuff
  3. RouteConfig.cs - Contains Routing  configuration
  4. Startup.Auth.cs  - Contains Authorization stuffs

3:- fonts:
Fonts folder contains custom font files for your application.

4:- Controller
This folder contains the controller and their methods. The controller is responsible for processing the user request and return output.

5:- Models
This folder contains the class files for entities or properties used to store the input values.

6:- View
This folder contains the UI pages including shared page, .CSHTMl, .VBHTML, HTML, aspx pages that show the output to the end user.

7:- Content
This folder is used to store files related to design and UI such as CSS files, images which is required for UI.

8:- Script
This folder contains the Script files such as JavaScript, jQuery, AngularJS , TypeScript, etc.

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

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

11:- Web.config:
Web.config file contains application level configurations.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.