ASP.NET MVC Basics

1. MVC project folder description

  App_Data: used to save data files, such as XML files, etc.;

  App_Start: Contains related classes for mvc system startup;

  Controller: The code file that stores the entire project "controller";

  Models: View code files (web pages/interfaces) that store the entire project;

2. Description of important documents

  web.config under Views: is the configuration file for the entire view

  web.config under the root directory: configuration for the entire project

3. Controller

  Action method of the controller: used to respond to the client request, and call the responding view to output information to the browser;

  Controller method:

    (1) Get data: receive request data;

    (2) Business processing: interact with model;

    (3) Return to the view or jump to other controllers;

4. View access and addressing rules:

  Use the View() method in the controller to call the view and return the view with the same name as the "action method";

  Addressing rules: The View() method searches for the folder with the same name as the controller from the "Views folder" by default;

5. Conventions in MVC

  Controller: must end with Controller;

  View: It must be placed in the Views folder and created in a subdirectory with the same name as the controller;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325400099&siteId=291194637