ASP.NET MVC

Explain ASP.NET MVC File and Folder Structure

Explain ASP.NET MVC File and Folder Structure

MVC File and Folder Structure

ASP.NET MVC 5 application, Visual Studio by default creates the following files and for our application

.


App_Data
Contains data files linked to the programme, such as.mdf files, LocalDB files, XML files, etc. The most crucial thing to keep in mind is that IIS will never serve files from this App_Data folder. Since we don't have any data files, this folder is empty in our example. We will go over how to store application-related data files in the App_Data Folder in our subsequent posts.


App_Start:
Contains configuration-related class files that must be run when the programme launches. This folder contains the classes BundleConfig, FilterConfig, RouteConfig, IdentityConfig, etc.


Content
Contains static files, including image, CSS, and icon files, among others. The bootstrap.css, Site.css, and bootstrap.min.css files are automatically included by Visual Studio when we create a new ASP.NET MVC 5 application.


Controllers
Contains all the controllers of your application. The Controllers are nothing but classes that are inherited from the base Controller class. The name of the Controller should end with the word “Controller”. It is this class that actually handles the user’s request i.e. the incoming HTTP Requests and returns a response.


Fonts
Contains the custom font files that are required for the application.

Models
Contains the class files which are used to store the domain/business data as well as business logic to manage the data.


Scripts
includes every JavaScript file needed for your application. By default, the relevant javascript files for jQuery and Bootstrap are provided when we construct an ASP.NET MVC 5 application. This folder or any subdirectory of this folder should be used for the creation of any custom Javascript files.


Views:
Contains all the “.cshtml” files of your application, where we need to write the HTML code along with the C# code. The Views folder also includes separate folders for each and every controller for your application. For example, all the .cshtml files of the HomeController will be in the View => Home folder. We also have the Shared folder under the Views folder. The Shared Folder contains all the views which are needed to be shared by different controllers e.g. error files,  layout files, etc.



MVC project also includes the following configuration files:

Global.asax
This file contains application specific information and application-level events, such as Application_BeginRequest, application_start, application_error, session_start, session_end, etc.

Packages.config
Managed by NuGet to track what packages and versions you have installed in the application.

Web.config
Contains application-level configurations.





Related Post

About Us

Community of IT Professionals

A Complete IT knowledgebase for any kind of Software Language, Development, Programming, Coding, Designing, Networking, Hardware and Digital Marketing.

Instagram