13

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 2

16

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi @Andreas Great answer, but I have a question, is it possible to change the name of the "ViewStartFileName" ?
Where is that PDF now?
10

Check the image below... (What is the 'page lifecycle' of an ASP.NET MVC page, compared to ASP.NET WebForms?)

enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.