Remember that at the time of ASP, we often use master page masterpage. MVC also has this feature, which is more convenient to apply than masterpage.
Before this exercise, all of the MVC exercises were to create separate pages. Insus.net would like to take the example of previous exercises and move to the master page. In the case of ASP, if you want to put a single page that has already been written into the MasterPage master page, with insus.net experience, you have to recreate it and then copy the relevant content to the new page. Now MVC, moving a page that already exists to the master page, is fairly easy, with one or two lines of code.
MVC creates a site master page, where you can add a shared directory to the views directory first. This can be the master page _layout.cshtml created here.
Insert the knowledge point, in the #17 line code, in order to output an "@" character, just put one more "@" on the line.
Change the existing page, just modify the following sentence Layout = "~/views/shared/_layout.cshtml"; Such as
Detailed real-time operation process: