共用方式為


RazorPageAdapter 類別

定義

實作 IRazorPage,讓 RazorPageBase 衍生類別不會啟動兩次。 頁面會在處理常式方法執行之前啟動,但 RazorView 也會啟動每個頁面。

public ref class RazorPageAdapter : Microsoft::AspNetCore::Mvc::Razor::IRazorPage
public class RazorPageAdapter : Microsoft.AspNetCore.Mvc.Razor.IRazorPage
type RazorPageAdapter = class
    interface IRazorPage
Public Class RazorPageAdapter
Implements IRazorPage
繼承
RazorPageAdapter
實作

建構函式

RazorPageAdapter(RazorPageBase)
已淘汰.

實作 IRazorPage,讓 RazorPageBase 衍生類別不會啟動兩次。 頁面會在處理常式方法執行之前啟動,但 RazorView 也會啟動每個頁面。

RazorPageAdapter(RazorPageBase, Type)

執行個體化 RazorPageAdapter 的新執行個體。

屬性

BodyContent

取得或設定本文內容。

IsLayoutBeingRendered

取得或設定旗標,這個旗標會判斷是否正在轉譯此頁面的配置。

Layout

取得或設定版面配置頁面的路徑。

Path

取得頁面的應用程式基底相對路徑。

PreviousSectionWriters

取得或設定此頁面可轉譯的區段。

SectionWriters

取得此頁面所定義的區段。

ViewContext

取得或設定轉譯檢視的檢視內容。

方法

EnsureRenderedBodyOrSections()

確認 中 PreviousSectionWriters 定義的所有區段都已轉譯,或如果未定義任何區段,則會轉譯本文。

ExecuteAsync()

轉譯頁面,並將輸出寫入至 Writer

適用於