To understand the MVC principle in a code screenshot

Source: Internet
Author: User

"Overview"looking at Mr. Jing Jinnan's "ASP. NET MVC framework Revealed", this book explains the principles of MVC in detail, it is very abstruse and very complex, see a few times before you will understand a little. In the first chapter he used an MVC framework he wrote himself as an example, the code looked a bit more, so in order to help understand, I would like to use a step-by-step description of the MVC process, I have limited ability to write bad, but also hope you forgive. If Mr. Jiang saw this article, he would also like to correct my understanding of the wrong place.   First, register the custom HttpModule in Web. config Second, enter the URL Third, add the default routing rules Iv. Registration of Postresolverequestcache Events v. Analysis of Routedata Vi. Resolving the requested controller and action Seven, package RequestContext Viii. acquisition of Mvchandler   ix. specifying Mvchandler processing HTTP requests   10. Set up controller objects by reflection   11. Set up controller objects by reflection   12. Execute the request with the generated controller object   13. Create action by Reflection   14. Create action by Reflection   15. Display results by custom Rawcontentresult 16. Results show  "Summary"The code used above is from Mr. Jiang's blog downloaded from the source code, after reading the book with a breakpoint step by step with a few times, a little understanding of the process. Make a summary of what Mr. Jiang says: The whole ASP. NET MVC framework is actually implemented by custom Httpmoudle (UrlRoutingModule) and HttpHandler (Mvchandler). hope this article can help more in the study of MVC friends, thank you for your support.

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.