Experience the ASPNET MVC PREVIEW5 (1)-Explore the principles of viewengine and compare the old and new editions

Source: Internet
Author: User

asp.net mvc is finally waiting for the new version, this time it is still preview version. There are a number of new features added to this version. Especially in the management of Viewengine. It has been greatly improved, not only to make it easier for users to replace Viewengine, And it's possible to use multiple viewengine in a single system, and this article explores how Viewengine works in the new and older editions and compares them, and then shows how to add one or more viewengine and let them work interactively.

First of all, the next P5 to viewengine improvements, in the old version, the system involves viewengine management has two interfaces, respectively: Iviewengine, Iviewlocator, where the ivewengine responsible for rendering view, Iviewlocator is responsible for the path handling of the view. At the same time, in the controller to select Viewengine, so that when the implementation of the viewengine passed to the Viewresult, Finally Viewresult uses Viewengine to render the UI. The old version of the View section is outlined below:

Its execution flow is roughly as follows: The MVC framework finds the corresponding controller based on routing data, and controller Initializes a viewengine based on iviewlocate (Iviewlocater is generally used for path selection) It then executes the controller Execute method, which performs the action indirectly through the Controlleractioninvoker, and each action returns a ActionResult object, and then It executes the ActionResult Executeresult method. The system has many kinds of actionresult, when the ActionResult is Viewresult, Controller will pass on the viewengine of your viewresult and eventually use Viewengine to render the data in Viewresult.

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.