Page 類別

定義

Razor 頁面的基類。

public ref class Page abstract : Microsoft::AspNetCore::Mvc::RazorPages::PageBase
public abstract class Page : Microsoft.AspNetCore.Mvc.RazorPages.PageBase
type Page = class
    inherit PageBase
Public MustInherit Class Page
Inherits PageBase
繼承

建構函式

Page()

Razor 頁面的基類。

屬性

BodyContent

取得或設定本文內容。

(繼承來源 RazorPageBase)
DiagnosticSource

取得或設定 DiagnosticSource 用來檢測頁面執行的實例。

(繼承來源 RazorPageBase)
HtmlEncoder

HtmlEncoder取得當這個 RazorPage 處理非 IHtmlContent C# 運算式時要使用的 。

(繼承來源 RazorPageBase)
HttpContext

取得 HttpContext

(繼承來源 PageBase)
IsLayoutBeingRendered

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

(繼承來源 RazorPageBase)
Layout

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

(繼承來源 RazorPageBase)
MetadataProvider

取得或設定 IModelMetadataProvider

(繼承來源 PageBase)
ModelState

取得 ModelStateDictionary

(繼承來源 PageBase)
Output

TextWriter取得頁面正在寫入輸出的 。

(繼承來源 RazorPageBase)
PageContext

PageContext

(繼承來源 PageBase)
Path

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

(繼承來源 RazorPageBase)
PreviousSectionWriters

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

(繼承來源 RazorPageBase)
Request

取得 HttpRequest

(繼承來源 PageBase)
Response

取得 HttpResponse

(繼承來源 PageBase)
RouteData

RouteData取得執行動作的 。

(繼承來源 PageBase)
SectionWriters

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

(繼承來源 RazorPageBase)
TempData

ITempDataDictionaryViewContext 取得 。

(繼承來源 RazorPageBase)
User

ClaimsPrincipal取得目前登入使用者的 。

(繼承來源 RazorPageBase)
ViewBag

取得動態檢視資料字典。

(繼承來源 RazorPageBase)
ViewContext

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

(繼承來源 PageBase)

方法

AddHtmlAttributeValue(String, Int32, Object, Int32, Int32, Boolean)

新增 html 屬性值。

(繼承來源 RazorPageBase)
BadRequest()

BadRequestResult建立產生回應的 Status400BadRequest

(繼承來源 PageBase)
BadRequest(ModelStateDictionary)

BadRequestObjectResult建立產生回應的 Status400BadRequest

(繼承來源 PageBase)
BadRequest(Object)

BadRequestObjectResult建立產生回應的 Status400BadRequest

(繼承來源 PageBase)
BeginAddHtmlAttributeValues(TagHelperExecutionContext, String, Int32, HtmlAttributeValueStyle)

開始新增 html 屬性值。

(繼承來源 RazorPageBase)
BeginContext(Int32, Int32, Boolean)

Razor 頁面的基類。

(繼承來源 PageBase)
BeginWriteAttribute(String, String, Int32, String, Int32, Int32)

開始寫出屬性。

(繼承來源 RazorPageBase)
BeginWriteTagHelperAttribute()

開始撰寫屬性值的新範圍 ITagHelper

(繼承來源 RazorPageBase)
Challenge()

建立 ChallengeResult

(繼承來源 PageBase)
Challenge(AuthenticationProperties)

使用指定的 properties 建立 ChallengeResult

(繼承來源 PageBase)
Challenge(AuthenticationProperties, String[])

ChallengeResult使用指定的驗證配置和 properties 建立 。

(繼承來源 PageBase)
Challenge(String[])

使用指定的驗證配置建立 ChallengeResult

(繼承來源 PageBase)
Content(String)

ContentResult藉由指定 content 字串來建立 物件 Status200OK

(繼承來源 PageBase)
Content(String, MediaTypeHeaderValue)

ContentResult藉由指定 content 字串和 contentType 來建立 物件 Status200OK

(繼承來源 PageBase)
Content(String, String)

ContentResult藉由指定 content 字串和內容類型來建立 物件 Status200OK

(繼承來源 PageBase)
Content(String, String, Encoding)

ContentResult藉由指定 content 字串、 contentType 、 和 contentEncoding 來建立 物件 Status200OK

(繼承來源 PageBase)
CreateTagHelper<TTagHelper>()

建立並啟動 ITagHelper

(繼承來源 RazorPageBase)
DefineSection(String, Func<Object,Task>)

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

(繼承來源 RazorPageBase)
DefineSection(String, RenderAsyncDelegate)

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

(繼承來源 RazorPageBase)
EndAddHtmlAttributeValues(TagHelperExecutionContext)

結束新增 html 屬性值。

(繼承來源 RazorPageBase)
EndContext()

Razor 頁面的基類。

(繼承來源 PageBase)
EndTagHelperWritingScope()

結束呼叫 所啟動 StartTagHelperWritingScope(HtmlEncoder) 的目前寫入範圍。

(繼承來源 RazorPageBase)
EndWriteAttribute()

結束寫入屬性。

(繼承來源 RazorPageBase)
EndWriteTagHelperAttribute()

結束呼叫 所啟動 BeginWriteTagHelperAttribute() 的目前寫入範圍。

(繼承來源 RazorPageBase)
EnsureRenderedBodyOrSections()

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

(繼承來源 PageBase)
ExecuteAsync()

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

(繼承來源 RazorPageBase)
File(Byte[], String)

傳回指定 fileContents 為內容 (Status200OK) 和指定 contentType 為 Content-Type 的檔案。

(繼承來源 PageBase)
File(Byte[], String, String)

傳回指定 fileContents 為內容 () Status200OK 、指定 contentType 為 Content-Type 和指定 fileDownloadName 為建議檔案名的檔案。

(繼承來源 PageBase)
File(Stream, String)

傳回指定 fileStream (Status200OK) 中指定 contentType 為 Content-Type 的檔案。

(繼承來源 PageBase)
File(Stream, String, String)

傳回指定 fileStream 之 (Status200OK) 中的檔案,其 contentType 指定為 Content-Type,以及指定 fileDownloadName 為建議的檔案名。

(繼承來源 PageBase)
File(String, String)

傳回 (virtualPathStatus200OK 所指定的檔案,) 指定 contentType 為 Content-Type。

(繼承來源 PageBase)
File(String, String, String)

傳回指定 virtualPath () Status200OK 指定的檔案,其 contentType 指定為 Content-Type,以及指定 fileDownloadName 為建議的檔案名。

(繼承來源 PageBase)
FlushAsync()

在回應資料流程上叫用 FlushAsync()OutputStream.FlushAsync ,將任何緩衝內容寫出至 Body

(繼承來源 RazorPageBase)
Forbid()

預設會建立 ForbidResult (Status403Forbidden) 。

(繼承來源 PageBase)
Forbid(AuthenticationProperties)

ForbidResult根據預設,使用指定的 properties 建立 (Status403Forbidden) 。

(繼承來源 PageBase)
Forbid(AuthenticationProperties, String[])

ForbidResult根據預設,使用指定的驗證配置和 properties 建立 (Status403Forbidden) 。

(繼承來源 PageBase)
Forbid(String[])

ForbidResultStatus403Forbidden 根據預設,使用指定的驗證配置建立) (。

(繼承來源 PageBase)
Href(String)

傳回指定內容路徑的 href。

(繼承來源 RazorPageBase)
InvalidTagHelperIndexerAssignment(String, String, String)

當標籤協助程式屬性為 null 時,格式化有關使用索引子的錯誤訊息。

(繼承來源 RazorPageBase)
LocalRedirect(String)

建立 LocalRedirectResult 物件,將 (Status302Found) 重新導向至指定的本機 localUrl

(繼承來源 PageBase)
LocalRedirectPermanent(String)

LocalRedirectResult使用指定的 localUrl 建立物件 Permanent ,並將 Status301MovedPermanently 設定為 true () 。

(繼承來源 PageBase)
LocalRedirectPermanentPreserveMethod(String)

LocalRedirectResult使用指定的 localUrl 建立物件, Permanent 並將 設定為 true,並將 PreserveMethod 設定為 true (Status308PermanentRedirect) 。

(繼承來源 PageBase)
LocalRedirectPreserveMethod(String)

LocalRedirectResult使用指定的 localUrl 建立物件, Permanent 並將 設定為 false,並將 PreserveMethod 設定為 true (Status307TemporaryRedirect) 。

(繼承來源 PageBase)
NotFound()

NotFoundResult建立產生回應的 Status404NotFound

(繼承來源 PageBase)
NotFound(Object)

NotFoundObjectResult建立產生回應的 Status404NotFound

(繼承來源 PageBase)
Page()

建立 PageResult 物件,將此頁面轉譯為回應的檢視。

(繼承來源 PageBase)
Partial(String)

PartialViewResult 由指定要轉譯的部分名稱來建立 。

(繼承來源 PageBase)
Partial(String, Object)

PartialViewResult 由指定要轉譯的部分名稱以及模型物件來建立 。

(繼承來源 PageBase)
PhysicalFile(String, String)

傳回 (physicalPathStatus200OK 所指定的檔案,) 指定 contentType 為 Content-Type。

(繼承來源 PageBase)
PhysicalFile(String, String, String)

傳回指定 physicalPath () Status200OK 指定的檔案,其 contentType 指定為 Content-Type,以及指定 fileDownloadName 為建議的檔案名。

(繼承來源 PageBase)
PopWriter()

從堆疊傳回文字寫入器。

(繼承來源 RazorPageBase)
PushWriter(TextWriter)

將文字寫入器放在堆疊上。

(繼承來源 RazorPageBase)
Redirect(String)

建立 RedirectResult 重新導向至指定 url 之 的 物件。

(繼承來源 PageBase)
RedirectPermanent(String)

RedirectResult使用指定的 url 建立物件 Permanent ,並將 Status301MovedPermanently 設定為 true () 。

(繼承來源 PageBase)
RedirectPermanentPreserveMethod(String)

RedirectResult使用指定的 url 建立物件, Permanent 並將 設定為 true,並將 PreserveMethod 設定為 true (Status308PermanentRedirect) 。

(繼承來源 PageBase)
RedirectPreserveMethod(String)

RedirectResult使用指定的 url 建立物件, Permanent 並將 設定為 false,並將 PreserveMethod 設定為 true (Status307TemporaryRedirect) 。

(繼承來源 PageBase)
RedirectToAction(String)

使用 actionName 將 () Status302Found 重新導向至指定的動作。

(繼承來源 PageBase)
RedirectToAction(String, Object)

使用 actionNamerouteValues 將 () Status302Found 重新導向至指定的動作。

(繼承來源 PageBase)
RedirectToAction(String, String)

使用 actionNamecontrollerName ,將 (Status302Found) 重新導向至指定的動作。

(繼承來源 PageBase)
RedirectToAction(String, String, Object)

使用指定的 、 controllerNamerouteValues ,將 (Status302Found) 重新導向至指定的 actionName 動作。

(繼承來源 PageBase)
RedirectToAction(String, String, Object, String)

使用指定的 、 、 和 ,將 (Status302Found) 重新導向至指定的 actionName 動作。 fragmentrouteValuescontrollerName

(繼承來源 PageBase)
RedirectToAction(String, String, String)

使用指定的 、 controllerNamefragment ,將 (Status302Found) 重新導向至指定的 actionName 動作。

(繼承來源 PageBase)
RedirectToActionPermanent(String)

使用指定的 actionName ,將 (Status301MovedPermanently) 重新導向至指定的動作,並將 Permanent 設定為 true。

(繼承來源 PageBase)
RedirectToActionPermanent(String, Object)

使用指定的 和 routeValues ,將 (Status301MovedPermanently) 重新導向至設定為 true 的指定 actionName 動作 Permanent

(繼承來源 PageBase)
RedirectToActionPermanent(String, String)

使用指定的 和 controllerName ,將 (Status301MovedPermanently) 重新導向至設定為 true 的指定 actionName 動作 Permanent

(繼承來源 PageBase)
RedirectToActionPermanent(String, String, Object)

使用指定的 、 controllerNamerouteValues ,將 (Status301MovedPermanently) 重新導向至設定為 true 的指定 actionName 動作 Permanent

(繼承來源 PageBase)
RedirectToActionPermanent(String, String, Object, String)

使用指定的 、 、 和 ,將 (Status301MovedPermanently) 重新導向至指定的動作,並將 fragmentPermanent 設定為 true。 routeValuescontrollerNameactionName

(繼承來源 PageBase)
RedirectToActionPermanent(String, String, String)

使用指定的 、 controllerNamefragment ,將 (Status301MovedPermanently) 重新導向至設定為 true 的指定 actionName 動作 Permanent

(繼承來源 PageBase)
RedirectToActionPermanentPreserveMethod(String, String, Object, String)

使用指定的 、 、 和 ,將 (Status308PermanentRedirect) 重新導向至指定的動作 Permanent ,並將 PreserveMethod 設定為 true。 fragmentrouteValuescontrollerNameactionName

(繼承來源 PageBase)
RedirectToActionPreserveMethod(String, String, Object, String)

使用指定的 、 、 和 ,將 () Status307TemporaryRedirect 重新導向至指定的動作 Permanent ,並將 PreserveMethod 設定為 false 並 fragment 設定為 true。 routeValuescontrollerNameactionName

(繼承來源 PageBase)
RedirectToPage()

將 (Status302Found) 重新導向至目前頁面。

(繼承來源 PageBase)
RedirectToPage(Object)

使用指定的 routeValues ,將 (Status302Found) 重新導向至目前頁面。

(繼承來源 PageBase)
RedirectToPage(String)

將 (Status302Found) 重新導向至指定的 pageName

(繼承來源 PageBase)
RedirectToPage(String, Object)

使用指定的 ,將 () Status302Found 重新導向至指定的 pageNamerouteValues

(繼承來源 PageBase)
RedirectToPage(String, String)

使用指定的 ,將 Status302Found () 重新導向至指定的 pageNamepageHandler

(繼承來源 PageBase)
RedirectToPage(String, String, Object, String)

使用指定的 和 ,將 (Status302Found) 重新導向至指定的 pageNamerouteValuesfragment

(繼承來源 PageBase)
RedirectToPage(String, String, String)

使用指定的 ,將 Status302Found () 重新導向至指定的 pageNamefragment

(繼承來源 PageBase)
RedirectToPagePermanent(String)

將 (Status301MovedPermanently) 重新導向至指定的 pageName

(繼承來源 PageBase)
RedirectToPagePermanent(String, Object)

使用指定的 ,將 Status301MovedPermanently () 重新導向至指定的 pageNamerouteValues

(繼承來源 PageBase)
RedirectToPagePermanent(String, String)

使用指定的 ,將 Status301MovedPermanently () 重新導向至指定的 pageNamepageHandler

(繼承來源 PageBase)
RedirectToPagePermanent(String, String, Object)

使用指定的 ,將 Status301MovedPermanently () 重新導向至指定的 pageNamerouteValues

(繼承來源 PageBase)
RedirectToPagePermanent(String, String, Object, String)

使用指定的 和 ,將 (Status301MovedPermanently) 重新導向至指定的 pageNamerouteValuesfragment

(繼承來源 PageBase)
RedirectToPagePermanent(String, String, String)

使用指定的 ,將 Status301MovedPermanently () 重新導向至指定的 pageNamefragment

(繼承來源 PageBase)
RedirectToPagePermanentPreserveMethod(String, String, Object, String)

使用指定的 、 和 ,將 Status308PermanentRedirect () 重新導向至指定的路由,並將 Permanent 設定為 true 並 PreserveMethod 設定為 true。 fragmentrouteValuespageName

(繼承來源 PageBase)
RedirectToPagePreserveMethod(String, String, Object, String)

使用指定的 、 和 ,將 (Status307TemporaryRedirect) 重新導向至指定的頁面 Permanent ,並將 設定為 false 並 PreserveMethod 設定為 true。 fragmentrouteValuespageName

(繼承來源 PageBase)
RedirectToRoute(Object)

使用指定的 ,將 Status302Found () 重新導向至指定的 routeValues 路由。

(繼承來源 PageBase)
RedirectToRoute(String)

使用指定的 ,將 Status302Found () 重新導向至指定的 routeName 路由。

(繼承來源 PageBase)
RedirectToRoute(String, Object)

使用指定的 和 routeValues ,將 (Status302Found) 重新導向至指定的 routeName 路由。

(繼承來源 PageBase)
RedirectToRoute(String, Object, String)

使用指定的 、 routeValuesfragment ,將 (Status302Found) 重新導向至指定的 routeName 路由。

(繼承來源 PageBase)
RedirectToRoute(String, String)

使用指定的 和 fragment ,將 (Status302Found) 重新導向至指定的 routeName 路由。

(繼承來源 PageBase)
RedirectToRoutePermanent(Object)

使用指定的 routeValues ,將 (Status301MovedPermanently) 重新導向至指定的路由,並將 Permanent 設定為 true。

(繼承來源 PageBase)
RedirectToRoutePermanent(String)

使用指定的 routeName ,將 (Status301MovedPermanently) 重新導向至指定的路由,並將 Permanent 設定為 true。

(繼承來源 PageBase)
RedirectToRoutePermanent(String, Object)

使用指定的 routeNamerouteValues ,將 (Status301MovedPermanently) 重新導向至指定的路由,並將 Permanent 設定為 true。

(繼承來源 PageBase)
RedirectToRoutePermanent(String, Object, String)

使用指定的 、 routeValuesfragment ,將 (Status301MovedPermanently) 重新導向至設定為 true 的指定 routeName 路由 Permanent

(繼承來源 PageBase)
RedirectToRoutePermanent(String, String)

使用指定的 routeNamefragment ,將 (Status301MovedPermanently) 重新導向至指定的路由,並將 Permanent 設定為 true。

(繼承來源 PageBase)
RedirectToRoutePermanentPreserveMethod(String, Object, String)

使用指定的 、 和 ,將 Status308PermanentRedirect () 重新導向至指定的路由,並將 Permanent 設定為 true 並 PreserveMethod 設定為 true。 fragmentrouteValuesrouteName

(繼承來源 PageBase)
RedirectToRoutePreserveMethod(String, Object, String)

使用指定的 、 和 ,將 (Status307TemporaryRedirect) 重新導向至指定的路由,並將 Permanent 設定為 false 並 PreserveMethod 設定為 true。 fragmentrouteValuesrouteName

(繼承來源 PageBase)
SetAntiforgeryCookieAndHeader()

在回應上設定反分叉 Cookie 和 X-Frame-Options 標頭。

(繼承來源 RazorPageBase)
SignIn(ClaimsPrincipal, AuthenticationProperties, String)

SignInResult使用指定的驗證配置和 properties 建立 。

(繼承來源 PageBase)
SignIn(ClaimsPrincipal, String)

SignInResult使用指定的驗證配置建立 。

(繼承來源 PageBase)
SignOut(AuthenticationProperties, String[])

SignOutResult使用指定的驗證配置和 properties 建立 。

(繼承來源 PageBase)
SignOut(String[])

SignOutResult使用指定的驗證配置建立 。

(繼承來源 PageBase)
StartTagHelperWritingScope(HtmlEncoder)

啟動新的寫入範圍,並選擇性地覆寫 HtmlEncoder 該範圍內。

(繼承來源 RazorPageBase)
StatusCode(Int32)

藉由指定 statusCode 來建立 StatusCodeResult 物件。

(繼承來源 PageBase)
StatusCode(Int32, Object)

藉由指定 statusCode 和 來建立 ObjectResult 物件value

(繼承來源 PageBase)
TryUpdateModelAsync(Object, Type, String)

使用來自 Page 目前 IValueProviderprefix 的值,更新指定的 model 實例。

(繼承來源 PageBase)
TryUpdateModelAsync(Object, Type, String, IValueProvider, Func<ModelMetadata,Boolean>)

使用 valueProviderprefix 更新指定的 model 實例。

(繼承來源 PageBase)
TryUpdateModelAsync<TModel>(TModel)

使用目前 PageIValueProvider 的值更新指定的 model 實例。

(繼承來源 PageBase)
TryUpdateModelAsync<TModel>(TModel, String)

使用來自 Page 目前 IValueProviderprefix 的值,更新指定的 model 實例。

(繼承來源 PageBase)
TryUpdateModelAsync<TModel>(TModel, String, Expression<Func<TModel,Object>>[])

使用來自 Page 目前 IValueProviderprefix 的值,更新指定的 model 實例。

(繼承來源 PageBase)
TryUpdateModelAsync<TModel>(TModel, String, Func<ModelMetadata,Boolean>)

使用來自 Page 目前 IValueProviderprefix 的值,更新指定的 model 實例。

(繼承來源 PageBase)
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider)

使用 valueProviderprefix 更新指定的 model 實例。

(繼承來源 PageBase)
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Expression<Func<TModel,Object>>[])

使用 valueProviderprefix 更新指定的 model 實例。

(繼承來源 PageBase)
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Func<ModelMetadata,Boolean>)

使用 valueProviderprefix 更新指定的 model 實例。

(繼承來源 PageBase)
TryValidateModel(Object)

驗證指定的 model 實例。

(繼承來源 PageBase)
TryValidateModel(Object, String)

驗證指定的 model 實例。

(繼承來源 PageBase)
Unauthorized()

UnauthorizedResult建立會產生回應的 Status401Unauthorized

(繼承來源 PageBase)
ViewComponent(String)

ViewComponentResult 由指定要轉譯的檢視元件名稱來建立 。

(繼承來源 PageBase)
ViewComponent(String, Object)

ViewComponentResult 由指定要轉譯的檢視元件名稱來建立 。

(繼承來源 PageBase)
ViewComponent(Type)

指定要 ViewComponentResultType 轉譯之檢視元件的 ,以建立 。

(繼承來源 PageBase)
ViewComponent(Type, Object)

指定要 ViewComponentResultType 轉譯之檢視元件的 ,以建立 。

(繼承來源 PageBase)
Write(Object)

使用 HTML 編碼 Output 將指定的 value 寫入 。

(繼承來源 RazorPageBase)
Write(String)

使用 HTML 編碼 Output 將指定的 value 寫入 。

(繼承來源 RazorPageBase)
WriteAttributeValue(String, Int32, Object, Int32, Int32, Boolean)

寫出屬性值。

(繼承來源 RazorPageBase)
WriteLiteral(Object)

將沒有 HTML 編碼 Output 的指定 value 寫入 。

(繼承來源 RazorPageBase)
WriteLiteral(String)

將沒有 HTML 編碼 Output 的指定 value 寫入 。

(繼承來源 RazorPageBase)

適用於