ASP. NET MVC-Explore application folders

Source: Internet
Author: User

In order to learn ASP. NET MVC, we will build an Internet application.

Part 2nd: Explore the Application folder.

MVC folder

The folder contents of a typical ASP. NET MVC Web application are as follows:

Application information

Properties
References

Application Folder

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

Configuration file

Global.asax
Packages.config
Web. config

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

Standardized naming reduces the amount of code while helping developers understand the MVC project.

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

App_Data folder

The App_Data folder is used to store application data.

We'll cover adding the SQL database to the App_Data folder later in this 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. The 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.css file in the content folder. This stylesheet file is the file you need to edit when you want to change the application style.

We will edit this stylesheet file (SITE.CSS) in the next chapter of this tutorial.

Controllers folder

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

MVC requires that the names of all controller files end with "controller".

Visual Web Developer has created good one home controller (for home page and about page) and an account controller (for the Login page):

We will create more controllers in the chapters later in this tutorial.

Models folder

The Models folder contains classes that represent the application model. The model controls and operates data for the application.

We will create the model (class) in the sections later in this tutorial.

Views folder

The Views folder is used to store HTML files (user interface) related to the display of the application.

The Views folder contains a 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 registering and signing in for user accounts.

The home folder is used to store application pages such as home pages and about pages.

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

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

Scripts folder

The Scripts folder stores the application's JavaScript files.

By default, Visual Web Developer stores Standard MVC, Ajax, and JQuery files in this folder:

Note: a file named "Modernizr" is used to support HTML5 and CSS3 JavaScript files in your application.

ASP. NET MVC-Explore application folders

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.