ASP.NET MVC | Create an Application

Table of contents

first

NO.1

No.2

App_Data folder

Content folder

Controllers folder

Models folder

Views folder

Scripts folder

at last


first

Step by step, the vs2019 software needs to be installed on the computer. It doesn't matter whether the version is high or low, just the number of functions.

It looks like this, don't install it wrong!

NO.1

The first step is to open the software, and then follow my pictures step by step.

Create a new project.

Search the web, and then choose to be optimistic about the marked positions in the pictures, and all of them must be matched.

In the next step, the position of the name is up to you. I'm used to putting it on the table.

 Because we are mvc, so it is convenient and fast to choose mvc directly, remember to cancel https.

 Click Create to create the project successfully.

No.2

Look at the folders on the left, which represent where their respective things are.

   

The folder names are the same for all MVC applications. The MVC framework is based on default naming. Controllers are written in the Controllers folder, views are written in the Views folder, and models are written in the Models folder. You don't have to use folder names in your application code.

Standardized naming reduces the amount of code, and at the same time facilitates developers' understanding of MVC projects.

App_Data folder

The App_Data  folder is used to store application data.


Content folder

The Content  folder is used to store static files such as style sheets (CSS files), icons, and images.


Controllers folder

The Controllers folder contains controller classes responsible for handling user input and responses.

MVC requires that all controller file names end with "Controller".

After creating the project, a Home controller has been created.


Models folder

The Models folder contains classes that represent the application models. Models control and manipulate application data.


Views folder

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

The Views folder contains a folder for each controller.


Scripts folder

The Scripts folder stores the application's JavaScript files.

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


at last

This chapter introduces the process of creating a project and the introduction of some things that come with the created project.

In fact, after creating a project, you can follow the courses you have learned or find courses on the Internet to learn mvc in depth. You can’t understand it after reading the tutorial, and you have to be guided by someone, or a teacher will guide you in, so that you can practice by yourself.

Guess you like

Origin blog.csdn.net/SFalS/article/details/129140547