RazorPageBase.DefineSection Method

Definition

Overloads

DefineSection(String, Func<Object,Task>)

Creates a named content section in the page that can be invoked in a Layout page using RenderSection or RenderSectionAsync

DefineSection(String, RenderAsyncDelegate)

Creates a named content section in the page that can be invoked in a Layout page using RenderSection or RenderSectionAsync

DefineSection(String, Func<Object,Task>)

Source:
RazorPageBase.cs
Source:
RazorPageBase.cs
Source:
RazorPageBase.cs

Creates a named content section in the page that can be invoked in a Layout page using RenderSection or RenderSectionAsync

C#
protected void DefineSection (string name, Func<object,System.Threading.Tasks.Task> section);
C#
protected void DefineSection (string name, Func<object?,System.Threading.Tasks.Task> section);

Parameters

name
String

The name of the section to create.

section
Func<Object,Task>

The delegate to execute when rendering the section.

Remarks

This is a temporary placeholder method to support ASP.NET Core 2.0.0 editor code generation.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

DefineSection(String, RenderAsyncDelegate)

Source:
RazorPageBase.cs
Source:
RazorPageBase.cs
Source:
RazorPageBase.cs

Creates a named content section in the page that can be invoked in a Layout page using RenderSection or RenderSectionAsync

C#
public virtual 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

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0