WP TutorialLesson 4Free preview
WebPages Layout
This lesson is part of ASP · All levels
Summary
Layouts allow shared layouts such as header, navigation, and footer to be written once and then used by multiple pages. On Web Pages, layouts are created in the _Layout.cshtml file and the child page calls it via @RenderBody(). So the display changes only need to be done in one place without editing every page.
Key points
- The layout is stored in the _Layout.cshtml file in the shared folder.
- The child page enters its content through the @RenderBody() function.
- @RenderSection() is used for optional content areas such as additional scripts.
- Folder Views or root projects become the default location of the search layout.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.