To use layouts, we must next create a Razor .cshtml file to define the default layout for all Razor Pages (and all MVC views). The name of this file can be anything, but _Layout.cshtml is good practice, so that is the name that you previously set in the _ViewStart.cshtml file.
In Visual Studio 2017, in the Pages folder, add a new MVC View Layout Page item.
In Visual Studio Code, in the Pages folder, create a file named _Layout.cshtml.
In both Visual Studio 2017 and Visual Studio Code, modify the content of _Layout.cshtml, as shown in the following markup (it is similar to index.cshtml, so you can copy and paste it from there):
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content= ...