I've been googling for a while trying to see the use of the file _ViewStart.cshtml but the only one I see is setting the layout to the views statically or dynamically
Can I use the file _ViewStart.cshtml to do something else?
I've been googling for a while trying to see the use of the file _ViewStart.cshtml but the only one I see is setting the layout to the views statically or dynamically
Can I use the file _ViewStart.cshtml to do something else?
It is used set the default layout for the website. This can be overridden in the view.
Additionally you could write logic to change the layout for some reason e.g. different layout for different devices.
You could also save data to the tempdata.
Some understanding around the purpose of the ViewStart page: