In default mvc app. There are Layout and content pages, You know (_Layout, Home, Contact, etc.)
And content pages do not contain layout refrence as this:
Layout = "~/Views/Shared/_Layout.cshtml";
In content pages this code is missing.
But they works. How does it do this without layout refrence?
Because your
_ViewStart.cshtmlcontains a reference to the default layout that will be used when a specific one is not stated on the view.When you want to change the layout for a single view, you would include a
Layout = "...";to that view.