View layouts are similar to master pages in good old ASP.NET Web Forms. They define a base layout and, possibly, default contents that several views can use, so as to maximize, reuse, and offer a consistent structure. An example view layout can be seen in the following screenshot:
View layouts themselves are also Razor views, and they can be controlled by setting the Layout property in a view, which is defined in the RazorPage base class, as follows:
@{ Layout = "_Layout"; }
The Layout property is just the name of a view, one that can be discovered in the usual way.
The only thing that is required in a layout view is a call to the RenderBody method; this causes the actual view that is using it to be rendered. It is also possible to define section placeholders, which may be used by actual views to...