"Change pages and layout" section. (#10281)
Addresses #9858. This is a best-guess attempt at adding the required section. I know it goes without saying, but please let me know what changes are required and I'll get them sorted within a day or so. --- If there are other issues I can take a look at, please also label them with `good first issue`. <!-- # Instructions When creating a new PR, please reference the issue number if there is one: Fixes #Issue_Number The "Fixes #nnn" syntax in the PR description allows GitHub to automatically close the issue when this PR is merged. NOTE: This is a comment; please type your descriptions above or below it. -->pull/10283/head
parent
e961eee392
commit
f89d4a643d
|
@ -54,6 +54,12 @@ The `DisplayNameFor` HTML Helper inspects the `Title` property referenced in the
|
|||
|
||||
The `@model` directive specifies the type of the model passed to the Razor Page. In the preceding example, the `@model` line makes the `PageModel`-derived class available to the Razor Page. The model is used in the `@Html.DisplayNameFor` and `@Html.DisplayFor` [HTML Helpers](/aspnet/mvc/overview/older-versions-1/views/creating-custom-html-helpers-cs#understanding-html-helpers) on the page.
|
||||
|
||||
### The layout page
|
||||
|
||||
Select the menu links (**RazorPagesMovie**, **Home**, and **Privacy**). Each page shows the same menu layout. The menu layout is implemented in the *Views/Shared/_Layout.cshtml* file. Open the *Views/Shared/_Layout.cshtml* file.
|
||||
|
||||
[Layout](xref:mvc/views/layout) templates allow you to specify the HTML container layout of your site in one place and then apply it across multiple pages in your site. Find the `@RenderBody()` line. `RenderBody` is a placeholder where all the page-specific views you create show up, *wrapped* in the layout page. For example, if you select the **Privacy** link, the **Views/Home/Privacy.cshtml** view is rendered inside the `RenderBody` method.
|
||||
|
||||
<a name="vd"></a>
|
||||
### ViewData and layout
|
||||
|
||||
|
|
Loading…
Reference in New Issue