RazorPage.RenderSection Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
RenderSection(String) |
In layout pages, renders the content of the section named |
RenderSection(String, Boolean) |
In layout pages, renders the content of the section named |
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.