RazorPage.DefineSection(String, RenderAsyncDelegate) Method

Definition

Creates a named content section in the page that can be invoked in a Layout page using RenderSection(String) or RenderSectionAsync(String, Boolean).

C#
public void DefineSection (string name, Microsoft.AspNetCore.Mvc.Razor.RenderAsyncDelegate section);
C#
public override void DefineSection (string name, Microsoft.AspNetCore.Mvc.Razor.RenderAsyncDelegate section);

Parameters

name
String

The name of the section to create.

section
RenderAsyncDelegate

The RenderAsyncDelegate to execute when rendering the section.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0