共用方式為


RazorPage.DefineSection(String, RenderAsyncDelegate) 方法

定義

使用 或 RenderSectionAsync(String, Boolean) ,在頁面中建立可在版面配置頁面中 RenderSection(String) 叫用的具名內容區段。

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)

參數

name
String

要建立的區段名稱。

section
RenderAsyncDelegate

RenderAsyncDelegate 譯區段時要執行的 。

適用於