I’m just a newbie to MVC.
I’ve started reading Professional ASP.NET MVC3 by Jon Galloway, Phil Haack, Brad Wilson, Scott Allen
I’ve seen a method named as `ReleaseView, when trying learning on how to create a custom view. I’ve googled about that and found a definition of it.
My Questions are: When it the method(ReleaseView) gets called? And where are the other places it can be used ?
The definetion of ReleaseView on msdn is that . So, can i make use of this method in my controller action ?
Releases the specified view by using the specified controller context
Please suggest me if i’m going wrong
It is called by the
ViewResultBase.ExecuteResultmethod:Notice how once the view is rendered to the output stream, the ReleaseView method is called. So basically every time a controller action returns a View or a PartialView, when this ActionResult completes executing it will call the ReleaseView method on the underlying view engine.
For example if you are writing custom ActionResults.
No, the controller action has finished executing much before the view engine starts executing.