Share via


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).

public:
 void DefineSection(System::String ^ name, Microsoft::AspNetCore::Mvc::Razor::RenderAsyncDelegate ^ section);
public:
 override void DefineSection(System::String ^ name, Microsoft::AspNetCore::Mvc::Razor::RenderAsyncDelegate ^ section);
public void DefineSection (string name, Microsoft.AspNetCore.Mvc.Razor.RenderAsyncDelegate section);
public override void DefineSection (string name, Microsoft.AspNetCore.Mvc.Razor.RenderAsyncDelegate section);
member this.DefineSection : string * Microsoft.AspNetCore.Mvc.Razor.RenderAsyncDelegate -> unit
override this.DefineSection : string * Microsoft.AspNetCore.Mvc.Razor.RenderAsyncDelegate -> unit
Public Sub DefineSection (name As String, section As RenderAsyncDelegate)
Public Overrides Sub DefineSection (name As String, section As RenderAsyncDelegate)

Parameters

name
String

The name of the section to create.

section
RenderAsyncDelegate

The RenderAsyncDelegate to execute when rendering the section.

Applies to