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?
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?)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With