December 2018
Beginner to intermediate
668 pages
15h 30m
English
Just as with Razor Pages, there is a file named _ViewStart.cshtml that gets executed by the View() method. It is used to set defaults that apply to all views.
For example, it sets the Layout property of all views to a shared layout file:
@{ Layout = "_Layout"; }
In the Shared folder, open the _Layout.cshtml file. Note that the title is being read from the ViewData dictionary that was set earlier in the Index.cshtml view.
Note the rendering of common styles to support Bootstrap and the two sections. During development, the fully commented and nicely formatted versions of CSS files will be used. For staging and release, the minified versions will be used:
<environment include="Development"> <link rel="stylesheet" ...
Read now
Unlock full access