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 scenarios:
- What is rendered first, master page or view?
- If i use
Response.End()in@{}block at the start of page does this interupt execution of page and stops render of the 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.
Using
Response.Endin any view will cause a completely blank page being rendered. Never use in any view.Response.Endbasically aborts the current thread by triggering aThreadAbortExceptionwhich is not something that you want to do in your Razor views.