ErrorModel 类

定义

此 API 支持 ASP.NET Core 标识默认 UI 基础结构,不应直接从代码使用。 将来的版本中可能会更改或删除此 API。

[Microsoft.AspNetCore.Authorization.AllowAnonymous]
[Microsoft.AspNetCore.Mvc.ResponseCache(Duration=0, Location=Microsoft.AspNetCore.Mvc.ResponseCacheLocation.None, NoStore=true)]
public class ErrorModel : Microsoft.AspNetCore.Mvc.RazorPages.PageModel
[<Microsoft.AspNetCore.Authorization.AllowAnonymous>]
[<Microsoft.AspNetCore.Mvc.ResponseCache(Duration=0, Location=Microsoft.AspNetCore.Mvc.ResponseCacheLocation.None, NoStore=true)>]
type ErrorModel = class
    inherit PageModel
Public Class ErrorModel
Inherits PageModel
继承
ErrorModel
属性

构造函数

ErrorModel()

此 API 支持 ASP.NET Core 标识默认 UI 基础结构,不应直接从代码使用。 将来的版本中可能会更改或删除此 API。

属性

HttpContext

获取 HttpContext

(继承自 PageModel)
MetadataProvider

获取或设置 IModelMetadataProvider

(继承自 PageModel)
ModelState

获取 ModelStateDictionary

(继承自 PageModel)
PageContext

获取 PageContext

(继承自 PageModel)
Request

获取 HttpRequest

(继承自 PageModel)
RequestId

此 API 支持 ASP.NET Core 标识默认 UI 基础结构,不应直接从代码使用。 将来的版本中可能会更改或删除此 API。

Response

获取 HttpResponse

(继承自 PageModel)
RouteData

RouteData获取执行操作的 。

(继承自 PageModel)
ShowRequestId

此 API 支持 ASP.NET Core 标识默认 UI 基础结构,不应直接从代码使用。 将来的版本中可能会更改或删除此 API。

TempData

获取或设置 ITempDataDictionary 使用的 PageResult

(继承自 PageModel)
Url

获取或设置 IUrlHelper

(继承自 PageModel)
User

ClaimsPrincipal获取与执行操作关联的用户的 。

(继承自 PageModel)
ViewData

获取 ViewDataDictionary

(继承自 PageModel)

方法

BadRequest()

创建一个 BadRequestResult 生成响应的 Status400BadRequest

(继承自 PageModel)
BadRequest(ModelStateDictionary)

创建一个 BadRequestObjectResult 生成响应的 Status400BadRequest

(继承自 PageModel)
BadRequest(Object)

创建一个 BadRequestObjectResult 生成响应的 Status400BadRequest

(继承自 PageModel)
Challenge()

创建一个 ChallengeResult

(继承自 PageModel)
Challenge(AuthenticationProperties)

ChallengeResult使用指定的 properties创建 。

(继承自 PageModel)
Challenge(AuthenticationProperties, String[])

ChallengeResult使用指定的身份验证方案和 properties创建 。

(继承自 PageModel)
Challenge(String[])

ChallengeResult使用指定的身份验证方案创建 。

(继承自 PageModel)
Content(String)

ContentResult通过指定字符串,使用 创建content对象Status200OK

(继承自 PageModel)
Content(String, MediaTypeHeaderValue)

ContentResult通过指定content字符串和 contentType创建对象Status200OK

(继承自 PageModel)
Content(String, String)

ContentResult通过指定content字符串和内容类型创建对象Status200OK

(继承自 PageModel)
Content(String, String, Encoding)

ContentResult通过指定content字符串 、 contentTypecontentEncoding来创建对象Status200OK

(继承自 PageModel)
File(Byte[], String)

返回一个文件,其中指定 fileContents 为内容 (Status200OK) ,指定 contentType 为 Content-Type。

(继承自 PageModel)
File(Byte[], String, String)

返回一个文件,其中指定 fileContents 为内容 (Status200OK) ,指定 contentType 为 Content-Type,指定 fileDownloadName 为建议的文件名。

(继承自 PageModel)
File(Stream, String)

返回指定 fileStream (Status200OK) 中指定 contentType 为 Content-Type 的文件。

(继承自 PageModel)
File(Stream, String, String)

返回指定 fileStream (Status200OK) 的文件, contentType 指定的 作为 Content-Type,指定 fileDownloadName 为建议的文件名。

(继承自 PageModel)
File(String, String)

返回由 virtualPath (Status200OK) 指定的文件,并将 指定 contentType 为 Content-Type。

(继承自 PageModel)
File(String, String, String)

返回由 virtualPath (Status200OK) 指定的文件, contentType 指定的 作为 Content-Type,而指定 fileDownloadName 为建议的文件名。

(继承自 PageModel)
Forbid()

默认情况下) ForbidResultStatus403Forbidden 创建 (。

(继承自 PageModel)
Forbid(AuthenticationProperties)

默认情况下,ForbidResultStatus403Forbidden使用指定的 properties创建 () 。

(继承自 PageModel)
Forbid(AuthenticationProperties, String[])

默认情况下,ForbidResultStatus403Forbidden使用指定的身份验证方案和 properties创建) (。

(继承自 PageModel)
Forbid(String[])

默认情况下, ForbidResult 使用指定的身份验证方案创建) (Status403Forbidden

(继承自 PageModel)
LocalRedirect(String)

创建一个 LocalRedirectResult 对象,该对象将 (Status302Found) 重定向到指定的本地 localUrl

(继承自 PageModel)
LocalRedirectPermanent(String)

LocalRedirectResultPermanent使用指定的 localUrl创建设置为 true 的对象, (Status301MovedPermanently) 。

(继承自 PageModel)
LocalRedirectPermanentPreserveMethod(String)

使用指定的 localUrl创建一个LocalRedirectResult对象Permanent,并将 设置为 true PreserveMethod (Status308PermanentRedirect) 。

(继承自 PageModel)
LocalRedirectPreserveMethod(String)

LocalRedirectResultPermanent使用指定的 localUrl创建设置为 false 且PreserveMethod设置为 true 的对象,Status307TemporaryRedirect () 。

(继承自 PageModel)
NotFound()

创建一个 NotFoundResult 生成响应的 Status404NotFound

(继承自 PageModel)
NotFound(Object)

创建一个 NotFoundObjectResult 生成响应的 Status404NotFound

(继承自 PageModel)
OnGet()

此 API 支持 ASP.NET Core 标识默认 UI 基础结构,不应直接从代码使用。 将来的版本中可能会更改或删除此 API。

OnPageHandlerExecuted(PageHandlerExecutedContext)

在处理程序方法执行之后,在操作结果执行之前调用。

(继承自 PageModel)
OnPageHandlerExecuting(PageHandlerExecutingContext)

在处理程序方法执行之前调用,在模型绑定完成后调用。

(继承自 PageModel)
OnPageHandlerExecutionAsync(PageHandlerExecutingContext, PageHandlerExecutionDelegate)

在调用处理程序方法之前,在模型绑定完成后异步调用。

(继承自 PageModel)
OnPageHandlerSelected(PageHandlerSelectedContext)

在选择处理程序方法之后,但在模型绑定发生之前调用。

(继承自 PageModel)
OnPageHandlerSelectionAsync(PageHandlerSelectedContext)

在选择处理程序方法之后,但在模型绑定发生之前异步调用。

(继承自 PageModel)
Page()

创建一个 PageResult 用于呈现页面的对象。

(继承自 PageModel)
Partial(String)

PartialViewResult通过指定要呈现的分部的名称来创建 。

(继承自 PageModel)
Partial(String, Object)

PartialViewResult通过指定要呈现的分部的名称和模型对象来创建 。

(继承自 PageModel)
PhysicalFile(String, String)

返回由 physicalPath (Status200OK) 指定的文件,并将 指定 contentType 为 Content-Type。

(继承自 PageModel)
PhysicalFile(String, String, String)

返回由 physicalPath (Status200OK) 指定的文件, contentType 指定的 作为 Content-Type,而指定 fileDownloadName 为建议的文件名。

(继承自 PageModel)
Redirect(String)

创建一个 RedirectResult 对象,该对象将 (Status302Found) 重定向到指定的 url

(继承自 PageModel)
RedirectPermanent(String)

RedirectResultPermanent使用指定的 url创建设置为 true 的对象, (Status301MovedPermanently) 。

(继承自 PageModel)
RedirectPermanentPreserveMethod(String)

使用指定的 url创建一个RedirectResult对象Permanent,并将 设置为 true PreserveMethod (Status308PermanentRedirect) 。

(继承自 PageModel)
RedirectPreserveMethod(String)

RedirectResultPermanent使用指定的 url创建设置为 false 且PreserveMethod设置为 true 的对象,Status307TemporaryRedirect () 。

(继承自 PageModel)
RedirectToAction(String)

使用 actionName将 (Status302Found) 重定向到指定的操作。

(继承自 PageModel)
RedirectToAction(String, Object)

使用 actionNamerouteValues将 (Status302Found) 重定向到指定的操作。

(继承自 PageModel)
RedirectToAction(String, String)

使用 actionNamecontrollerName将 (Status302Found) 重定向到指定的操作。

(继承自 PageModel)
RedirectToAction(String, String, Object)

Status302Found 使用指定的 、 controllerNamerouteValues将 () 重定向到指定的actionName操作。

(继承自 PageModel)
RedirectToAction(String, String, Object, String)

Status302Found 使用指定的 、、 controllerNamerouteValuesfragment将) (重定向到指定的actionName操作。

(继承自 PageModel)
RedirectToAction(String, String, String)

Status302Found 使用指定的 、 controllerNamefragment将 () 重定向到指定的actionName操作。

(继承自 PageModel)
RedirectToActionPermanent(String)

使用指定的 将 (Status301MovedPermanently) 重定向到设置为 true 的指定actionName操作Permanent

(继承自 PageModel)
RedirectToActionPermanent(String, Object)

使用指定的 和 routeValues将) Status301MovedPermanently (重定向到设置为 true 的指定actionName操作Permanent

(继承自 PageModel)
RedirectToActionPermanent(String, String)

使用指定的 和 controllerName将) Status301MovedPermanently (重定向到设置为 true 的指定actionName操作Permanent

(继承自 PageModel)
RedirectToActionPermanent(String, String, Object)

使用指定的 、 和 将 (Status301MovedPermanently) 重定向到设置为 true 的指定actionName操作PermanentrouteValuescontrollerName

(继承自 PageModel)
RedirectToActionPermanent(String, String, Object, String)

使用指定的 、、 routeValuescontrollerNamefragment将 (Status301MovedPermanently) 重定向到设置为 true 的指定actionName操作Permanent

(继承自 PageModel)
RedirectToActionPermanent(String, String, String)

使用指定的 、 和 将 (Status301MovedPermanently) 重定向到设置为 true 的指定actionName操作PermanentfragmentcontrollerName

(继承自 PageModel)
RedirectToActionPermanentPreserveMethod(String, String, Object, String)

使用指定的 、、 controllerNamerouteValuesfragment将 (Status308PermanentRedirect) 重定向到设置为 true 且PreserveMethod设置为 true 的指定actionName操作Permanent

(继承自 PageModel)
RedirectToActionPreserveMethod(String, String, Object, String)

使用指定的 、、 和 将 (Status307TemporaryRedirect) 重定向到设置为 false 且PreserveMethod设置为 true 的指定routeValuesactionNamecontrollerName操作。Permanentfragment

(继承自 PageModel)
RedirectToPage()

将 (Status302Found) 重定向到当前页。

(继承自 PageModel)
RedirectToPage(Object)

将 (Status302Found) 重定向到具有指定 routeValues的当前页。

(继承自 PageModel)
RedirectToPage(String)

将 (Status302Found) 重定向到指定的 pageName

(继承自 PageModel)
RedirectToPage(String, Object)

使用指定的 将 (Status302Found) 重定向到指定的 pageNamerouteValues

(继承自 PageModel)
RedirectToPage(String, String)

使用指定的 将 (Status302Found) 重定向到指定的 pageNamepageHandler

(继承自 PageModel)
RedirectToPage(String, String, Object)

使用指定的 和 将 (Status302Found) 重定向到指定的 pageNamepageHandlerrouteValues

(继承自 PageModel)
RedirectToPage(String, String, Object, String)

使用指定的 和 将 (Status302Found) 重定向到指定的 pageNamerouteValuesfragment

(继承自 PageModel)
RedirectToPage(String, String, String)

使用指定的 将 (Status302Found) 重定向到指定的 pageNamefragment

(继承自 PageModel)
RedirectToPagePermanent(String)

将 (Status301MovedPermanently) 重定向到指定的 pageName

(继承自 PageModel)
RedirectToPagePermanent(String, Object)

使用指定的 将 (Status301MovedPermanently) 重定向到指定的 pageNamerouteValues

(继承自 PageModel)
RedirectToPagePermanent(String, Object, String)

使用指定的 将 (Status301MovedPermanently) 重定向到指定的 pageNamefragment

(继承自 PageModel)
RedirectToPagePermanent(String, String)

将 (Status301MovedPermanently) 重定向到指定的 pageName

(继承自 PageModel)
RedirectToPagePermanent(String, String, Object)

使用指定的 将 (Status301MovedPermanently) 重定向到指定的 pageNamerouteValues

(继承自 PageModel)
RedirectToPagePermanent(String, String, Object, String)

使用指定的 和 将 (Status301MovedPermanently) 重定向到指定的 pageNamerouteValuesfragment

(继承自 PageModel)
RedirectToPagePermanent(String, String, String)

使用指定的 将 (Status301MovedPermanently) 重定向到指定的 pageNamefragment

(继承自 PageModel)
RedirectToPagePermanentPreserveMethod(String, String, Object, String)

使用pageName指定的 、 routeValuesfragment将) Status308PermanentRedirect (重定向到指定路由Permanent(设置为 true 和 PreserveMethod 设置为 true)。

(继承自 PageModel)
RedirectToPagePreserveMethod(String, String, Object, String)

使用指定的 、 和 将 (Status307TemporaryRedirect) 重定向到设置为 false 且PreserveMethod设置为 true 的指定pageName页面PermanentfragmentrouteValues

(继承自 PageModel)
RedirectToRoute(Object)

使用指定的 将 (Status302Found) 重定向到指定的 routeValues路由。

(继承自 PageModel)
RedirectToRoute(String)

使用指定的 将 (Status302Found) 重定向到指定的 routeName路由。

(继承自 PageModel)
RedirectToRoute(String, Object)

Status302Found 使用指定的 和 routeValues将 () 重定向到指定的routeName路由。

(继承自 PageModel)
RedirectToRoute(String, Object, String)

Status302Found 使用指定的 、 routeValuesfragment将 () 重定向到指定的routeName路由。

(继承自 PageModel)
RedirectToRoute(String, String)

Status302Found 使用指定的 和 fragment将 () 重定向到指定的routeName路由。

(继承自 PageModel)
RedirectToRoutePermanent(Object)

使用指定的 将 (Status301MovedPermanently) 重定向到设置为 true 的指定routeValues路由Permanent

(继承自 PageModel)
RedirectToRoutePermanent(String)

使用指定的 将 (Status301MovedPermanently) 重定向到设置为 true 的指定routeName路由Permanent

(继承自 PageModel)
RedirectToRoutePermanent(String, Object)

使用指定的 和 routeValues将 (Status301MovedPermanently) 重定向到设置为 true 的指定routeName路由Permanent

(继承自 PageModel)
RedirectToRoutePermanent(String, Object, String)

使用routeName指定的 、 routeValuesfragment将 (Status301MovedPermanently) 重定向到指定路由,并将 Permanent 设置为 true。

(继承自 PageModel)
RedirectToRoutePermanent(String, String)

使用指定的 和 fragment将 (Status301MovedPermanently) 重定向到设置为 true 的指定routeName路由Permanent

(继承自 PageModel)
RedirectToRoutePermanentPreserveMethod(String, Object, String)

使用routeName指定的 、 routeValuesfragment将) Status308PermanentRedirect (重定向到指定路由Permanent(设置为 true 和 PreserveMethod 设置为 true)。

(继承自 PageModel)
RedirectToRoutePreserveMethod(String, Object, String)

使用指定的 、 和 将) Status307TemporaryRedirect (重定向到设置为 false 且PreserveMethod设置为 true 的指定routeName路由PermanentfragmentrouteValues

(继承自 PageModel)
SignIn(ClaimsPrincipal, AuthenticationProperties, String)

SignInResult使用指定的身份验证方案和 properties创建 。

(继承自 PageModel)
SignIn(ClaimsPrincipal, String)

SignInResult使用指定的身份验证方案创建 。

(继承自 PageModel)
SignOut(AuthenticationProperties, String[])

SignOutResult使用指定的身份验证方案和 properties创建 。

(继承自 PageModel)
SignOut(String[])

SignOutResult使用指定的身份验证方案创建 。

(继承自 PageModel)
StatusCode(Int32)

StatusCodeResult通过指定 statusCode创建对象。

(继承自 PageModel)
StatusCode(Int32, Object)

ObjectResult通过指定 statusCode 和 创建对象value

(继承自 PageModel)
TryUpdateModelAsync(Object, Type, String)

使用 的当前 IValueProvidername中的值PageModel汇报指定的model实例。

(继承自 PageModel)
TryUpdateModelAsync(Object, Type, String, IValueProvider, Func<ModelMetadata,Boolean>)

使用 valueProvidername汇报指定的model实例。

(继承自 PageModel)
TryUpdateModelAsync<TModel>(TModel)

使用 的当前 IValueProvider中的值PageModel汇报指定的model实例。

(继承自 PageModel)
TryUpdateModelAsync<TModel>(TModel, String)

使用 的当前 IValueProvider中的值PageModel汇报指定的model实例。

(继承自 PageModel)
TryUpdateModelAsync<TModel>(TModel, String, Expression<Func<TModel,Object>>[])

使用 的当前 IValueProvidername中的值PageModel汇报指定的model实例。

(继承自 PageModel)
TryUpdateModelAsync<TModel>(TModel, String, Func<ModelMetadata,Boolean>)

使用 的当前 IValueProvidername中的值PageModel汇报指定的model实例。

(继承自 PageModel)
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider)

使用 valueProvidername汇报指定的model实例。

(继承自 PageModel)
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Expression<Func<TModel,Object>>[])

使用 valueProvidername汇报指定的model实例。

(继承自 PageModel)
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Func<ModelMetadata,Boolean>)

使用 valueProvidername汇报指定的model实例。

(继承自 PageModel)
TryValidateModel(Object)

验证指定的 model 实例。

(继承自 PageModel)
TryValidateModel(Object, String)

验证指定的 model 实例。

(继承自 PageModel)
Unauthorized()

UnauthorizedResult创建生成响应的 Status401Unauthorized

(继承自 PageModel)
ViewComponent(String)

ViewComponentResult通过指定要呈现的视图组件的名称来创建 。

(继承自 PageModel)
ViewComponent(String, Object)

ViewComponentResult通过指定要呈现的视图组件的名称来创建 。

(继承自 PageModel)
ViewComponent(Type)

ViewComponentResult通过指定要Type呈现的视图组件的 创建 。

(继承自 PageModel)
ViewComponent(Type, Object)

ViewComponentResult通过指定要Type呈现的视图组件的 创建 。

(继承自 PageModel)

适用于