My question in general about render pipeline, i have seen ASP.NET MVC pipeline scheme and there was a step called View Engine, so how it works? I want to know about this sce
What is rendered first, master page or view?
The view. The parser starts from the Layout and builds a LIFO (Last In First Out) structure recursing down to child views and partials. Once the LIFO is ready it starts popping out and processing the elements. This means that inner-most partials/views will be processed before the layout and the last one to be processed is the Layout itself.
If i use Response.End() in @{} block at the start of page does this interupt execution of page and stops render of the view?
Using Response.End
in any view will cause a completely blank page being rendered. Never use in any view. Response.End
basically aborts the current thread by triggering a ThreadAbortException
which is not something that you want to do in your Razor views.
Have a look at Steve Sanderson's Request-Handling Pipeline Poster. It explains the whole request process quite in detail. It's from MVC version 1.0, but it's still valid. Just replace 'WebForm' with Razor.
It really shouldn't bother you whether the master or the view is rendered first. Could you explain why this matters to you?