Understanding ASP.NET MVC Folder Structure
Remember points
- Each controller name ends with suffix controller.
- The single view directory can be used for entire application.
- By default all directories (folder) created with name of controller name.
Let us learn about major folders in brief
as in the following:
- App_Data
- App_Start
- fonts
- Content
- Controllers
- Models
- views
- 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:
- BundleConfig.cs - Contains Bundling related registration.
- IdentityConfig.cs - Contains Identity related stuff
- RouteConfig.cs - Contains Routing configuration
- 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.