Dela via


RazorPage.RenderSection Method

Definition

Overloads

RenderSection(String)

In layout pages, renders the content of the section named name.

RenderSection(String, Boolean)

In layout pages, renders the content of the section named name.

RenderSection(String)

Source:
RazorPage.cs
Source:
RazorPage.cs
Source:
RazorPage.cs

In layout pages, renders the content of the section named name.

public:
 Microsoft::AspNetCore::Html::HtmlString ^ RenderSection(System::String ^ name);
public Microsoft.AspNetCore.Html.HtmlString RenderSection (string name);
public Microsoft.AspNetCore.Html.HtmlString? RenderSection (string name);
member this.RenderSection : string -> Microsoft.AspNetCore.Html.HtmlString
Public Function RenderSection (name As String) As HtmlString

Parameters

name
String

The name of the section to render.

Returns

An empty IHtmlContent.

Remarks

The method writes to the Output and the value returned is a token value that allows the Write (produced due to @RenderSection(..)) to succeed. However the value does not represent the rendered content.

Applies to

RenderSection(String, Boolean)

Source:
RazorPage.cs
Source:
RazorPage.cs
Source:
RazorPage.cs

In layout pages, renders the content of the section named name.

public:
 Microsoft::AspNetCore::Html::HtmlString ^ RenderSection(System::String ^ name, bool required);
public Microsoft.AspNetCore.Html.HtmlString RenderSection (string name, bool required);
public Microsoft.AspNetCore.Html.HtmlString? RenderSection (string name, bool required);
member this.RenderSection : string * bool -> Microsoft.AspNetCore.Html.HtmlString
Public Function RenderSection (name As String, required As Boolean) As HtmlString

Parameters

name
String

The section to render.

required
Boolean

Indicates if this section must be rendered.

Returns

An empty IHtmlContent.

Remarks

The method writes to the Output and the value returned is a token value that allows the Write (produced due to @RenderSection(..)) to succeed. However the value does not represent the rendered content.

Applies to