RazorPage.DefineSection(String, RenderAsyncDelegate) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在页面中创建一个命名内容节,该节可以使用 或 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 节时要执行的 。