Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

ASP.NET MVC folder


May 12, 2021 ASP.NET


Table of contents


ASP.NET MVC - Application folder

ASP.NET folders should be included in the MVC web application? This section is described.

To learn ASP.NET MVC, we'll build an Internet application.

Part 2: Explore the application folder.


The MVC folder

A typical ASP.NET MVC web application is as follows:

ASP.NET MVC folder

Application information

Properties
References

The application folder

App_Data folder
Content folder
Controllers folder
Models folder
Scripts folder
Views folder

Profile

Global.asax
packages.config
Web.config

The folder names are the same for all MVC applications. T he MVC framework is named based on the default. T he controller is written in the Controllers folder, the view is written in the Views folder, and the model is written in the Models folder. You no longer have to use folder names in your application code.

Standardized naming reduces the amount of code and facilitates developers' understanding of MVC projects.

Here is a brief overview of the contents of each folder:


App_Data folder

App_Data folder is used to store application data.

We'll cover adding SQL databases to the folder later in App_Data tutorial.


Content folder

Content folders are used to hold static files, such as style sheets (CSS files), icons, and images.

Visual Web Developer automatically adds a themes folder to the Content folder. T he themes folder holds jQuery styles and pictures. In the project, you can delete this themes folder.

Visual Web Developer also adds a standard style sheet file to the project: the Site file in the content .css file. This style sheet file is the one you need to edit if you want to change the style of your application.

ASP.NET MVC folder

We'll edit this style sheet file (Site) in the next chapter .css.


Controllers folder

The Controllers folder contains the controller classes that are responsible for handling user input and the appropriate controller.

MVC requires the name of all controller files to end with "Controller".

Visual Web Developer has created a Home controller (for Home and About pages) and an Account controller (for Login pages):

ASP.NET MVC folder

We'll create more controllers later in this tutorial.


Models folder

The Models folder contains classes that represent the application model. The model controls and manipulates the application's data.

We'll create a model (class) later in this tutorial.


Views folder

Views folders are used to store HTML files (user interfaces) related to the display of an application.

The Views folder contains one folder for each controller.

In the Views folder, Visual Web Developer has created an Account folder, a Home folder, and a Shared folder.

The Account folder contains pages for user account registration and sign-in.

Home folders are used to store application pages such as home and out pages.

Shared folders are used to store views (master and layout pages) shared between controllers.

ASP.NET MVC folder

We'll edit these layout files in the next chapter of this tutorial.


Scripts folder

The Scripts folder stores JavaScript files for your application.

By default, Visual Web Developer holds standard MVC, Ajax, and jQuery files in this folder:

ASP.NET MVC folder

Note: A file named "modernizr" is a JavaScript file that enables applications to support HTML5 and CSS3.