1.MVC returns the view, the result is the Viewresult type
2.MVC the Executeresult method that returns the result is executed when the return result is executed
Here ActionResult is an abstract method, executed, will execute the rewritten method, that is, the viewresultbase Executeresult method;
As you can see, when you finally return to the view, Findview () is called, because this is an abstract method, the last call is the Findview () method in the ViewResult of Return view (), and the return value is Viewengineresult
3. Return to Viewengineresult, get the view engine, the view engine contains the found view (view property)
The front is just a simple process, if you do not see clearly, you can check against reflector, followed by the theme, MVC view default load Path 1. As you can see from the front, the view engine is mainly iviewengine this interface
There are mainly two view engine subclasses, and this is what we are familiar with razor and WebForm
Let's take a look atthe Razorviewengine constructor
Does it look familiar, this is the "Default view path" That MVC gives us, and if you want to create a new custom folder for yourself, MVC can automatically go inside to find the corresponding view:
1.
2. Clear the default engine, add your own definition of the engine, in the search for the view can be based on a custom folder to find the