RenderBody, RenderPage and RenderSection

These are the method inside view/shared/_layout.cshtml file

RenderBody renders child page. It is like the ContentPlaceHolder on master page and we can have only one RenderBody method in one layout page.

RenderPage renders the content of one page a static page within another page. The page where you will place the content could be layout or normal page.

@RenderPage("~/Views/Shared/_StaticRenderPage.cshtml")

RenderSection is located in _Layout page used to render only a section of page.

@RenderSection("scripts", required: false)
@section scripts{
    scripts
}

results matching ""

    No results matching ""