Understanding ASP. netmvc programming model in asp. NET

Source: Internet
Author: User

Understanding ASP. netmvc programming model in asp. NET
MVC Programming Model

MVC is one of ASP. NET development models.

MVC is a framework used to build web applications. It is designed using MVC (Model View Controller:

  • Model indicates the application CORE (such as the database record list)
  • View (View) displays data (database records)
  • Controller processes input (written to database records)

The MVC model also provides complete control over HTML, CSS, and JavaScript.

The MVC model defines web applications through three logical layers:

  • Business layer (business layer and model logic)
  • Display layer (display layer and view logic)
  • Input control (input control, controller logic)
Model)

A Model is a part of the application's data logic.

Typically, model objects access data in databases.

View)

View is a part of the application that processes data display.

Generally, a view is created from the model data.

Controller

A controller is a part of an application that processes user interaction.

Generally, the Controller reads data from the view, controls user input, and sends data to the model.

This split of MVC helps us manage complex applications, because you can focus on one aspect at a time. For example, you can design a view without relying on the business logic. At the same time, it is easier to design applications.

MVC splitting also simplifies group development. Different developers can develop views, controller logic, and business logic at the same time.

MVC folder

A typical ASP. net mvc web application has the following folder content:

Application Information
  • Properties
  • Reference
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 in all MVC applications are equal. The MVC framework is based on the default name. The Controller is located in the Controllers folder, the view is located in the Views folder, and the model is located in the Models folder. You do not need to use the folder name in the application code. Standardized naming reduces the amount of code and facilitates understanding of MVC projects.

The following is a brief description of each folder:

App_Data folder

The App_Data folder is used to store application data.

Content folder

The Content folder is used for static files, such as Style Sheets (CSS files), charts, and images.

Controllers folder

The Controllers folder contains the Controller class that processes user input and response.

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

Models folder

The Models folder contains classes that represent the application model. The model contains and operates applications.

Views folder

The Views folder contains HTML files related to application display (User Interface ).

The Views folder contains a folder for each controller.

The Account folder contains the page for registering and logging on to the user Account.

The Home folder is used to store application pages such as the Home page and related pages.

Shared Folders are used to store views Shared between controllers (template pages and layout pages ).

Scripts folder

The Scripts folder stores the JavaScript files of the application.

Related Article

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.