I am new to MVC so please bear with me. I am trying to find out who calls Viewstart.cshtml and what is the sequence of steps involved there? is it called after the route table is accessed or before it?
2 Answers
The RazorViewEngine has an internal readonly field "ViewStartFileName" which specifies the name of the start view. _ViewStart.cshtml (or .vbhtml) is called each time a RazorView instance is rendered (specifically when the RenderView() method is being executed). So the "who" would be the RazorViewEngine with its corresponding RazorView class (including their base classes). To get a quite good overview on the MVC request pipeline I recommend this pdf.
Check the image below... (What is the 'page lifecycle' of an ASP.NET MVC page, compared to ASP.NET WebForms?)
