MVC5 Learning Note Controller

Source: Internet
Author: User

Main reference book "ASP. MVC5 Advanced Programming (5th Edition)" Jon Galloway, etc.

1. MVC represents the model-view-controller. MVC is a pattern for developing applications that is well architected, testable, and easy to maintain. The MVC-based application contains:

Models: A class that represents the data for an application and enforces the data for the business rule using validation logic.

Views: template files that your application uses to dynamically generate HTML responses.

Controllers: The browser that processes the incoming request, the class retrieves the model's data, and then specifies the view template that returns the response to the browser.

2. The controller in the MVC pattern is primarily responsible for responding to user input and modifying the model when responding. The controller in the MVC pattern focuses on application flow, the processing of input data, and the provision of related view output data.

3. The adoption of the MVC pattern in web development requires that every user input in a Web application only takes the form of a request. For example, in ASP. NET MVC, each request is routed to a controller's method, and the controller is solely responsible for interpreting the requests, manipulating the model if necessary, and then selecting a view feedback to the user.

4. The only way to determine whether a class is a Controller class is to see if the class inherits from System.Web.Mvc.Controller.

5. The controller is the real core, each request must be handled by the controller, however some of these requests do not need model and view.

MVC5 Learning Note Controller

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.