August 2018
Intermediate to advanced
298 pages
5h 33m
English
Create a folder called Shared within the Views folder. Then, right-click on the Shared folder and select Add New Item from the context menu, as shown in the following screenshot:

When you click on the Add button, it will create _Layout.cshtml with the following content:
<!DOCTYPE html><html><head> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title></head><body> <div> @RenderBody() </div></body></html>
The preceding layout file is simple HTML content with a couple of Razor expressions. @ViewBag.title is used to display the title information passed from the controller and @RenderBody is ...
Read now
Unlock full access