Page Class

Definition

A base class for a Razor page.

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
Inheritance

Constructors

Page()

Properties

BodyContent

Gets or sets the body content.

(Inherited from RazorPageBase)
DiagnosticSource

Gets or sets a DiagnosticSource instance used to instrument the page execution.

(Inherited from RazorPageBase)
HtmlEncoder

Gets the HtmlEncoder to use when this RazorPage handles non-IHtmlContent C# expressions.

(Inherited from RazorPageBase)
HttpContext

Gets the HttpContext.

(Inherited from PageBase)
IsLayoutBeingRendered

Gets or sets a flag that determines if the layout of this page is being rendered.

(Inherited from RazorPageBase)
Layout

Gets or sets the path of a layout page.

(Inherited from RazorPageBase)
MetadataProvider

Gets or sets the IModelMetadataProvider.

(Inherited from PageBase)
ModelState

Gets the ModelStateDictionary.

(Inherited from PageBase)
Output

Gets the TextWriter that the page is writing output to.

(Inherited from RazorPageBase)
PageContext

The PageContext.

(Inherited from PageBase)
Path

Gets the application base relative path to the page.

(Inherited from RazorPageBase)
PreviousSectionWriters

Gets or sets the sections that can be rendered by this page.

(Inherited from RazorPageBase)
Request

Gets the HttpRequest.

(Inherited from PageBase)
Response

Gets the HttpResponse.

(Inherited from PageBase)
RouteData

Gets the RouteData for the executing action.

(Inherited from PageBase)
SectionWriters

Gets the sections that are defined by this page.

(Inherited from RazorPageBase)
TempData

Gets the ITempDataDictionary from the ViewContext.

(Inherited from RazorPageBase)
User

Gets the ClaimsPrincipal of the current logged in user.

(Inherited from RazorPageBase)
ViewBag

Gets the dynamic view data dictionary.

(Inherited from RazorPageBase)
ViewContext

Gets or sets the view context of the rendering view.

(Inherited from PageBase)

Methods

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

Add an html attribute value.

(Inherited from RazorPageBase)
BadRequest()

Creates a BadRequestResult that produces a Status400BadRequest response.

(Inherited from PageBase)
BadRequest(ModelStateDictionary)

Creates a BadRequestObjectResult that produces a Status400BadRequest response.

(Inherited from PageBase)
BadRequest(Object)

Creates a BadRequestObjectResult that produces a Status400BadRequest response.

(Inherited from PageBase)
BeginAddHtmlAttributeValues(TagHelperExecutionContext, String, Int32, HtmlAttributeValueStyle)

Begins adding html attribute values.

(Inherited from RazorPageBase)
BeginContext(Int32, Int32, Boolean) (Inherited from PageBase)
BeginWriteAttribute(String, String, Int32, String, Int32, Int32)

Begins writing out an attribute.

(Inherited from RazorPageBase)
BeginWriteTagHelperAttribute()

Starts a new scope for writing ITagHelper attribute values.

(Inherited from RazorPageBase)
Challenge()

Creates a ChallengeResult.

(Inherited from PageBase)
Challenge(AuthenticationProperties, String[])

Creates a ChallengeResult with the specified authentication schemes and properties.

(Inherited from PageBase)
Challenge(AuthenticationProperties)

Creates a ChallengeResult with the specified properties.

(Inherited from PageBase)
Challenge(String[])

Creates a ChallengeResult with the specified authentication schemes.

(Inherited from PageBase)
Content(String, MediaTypeHeaderValue)

Creates a ContentResult object with Status200OK by specifying a content string and a contentType.

(Inherited from PageBase)
Content(String, String, Encoding)

Creates a ContentResult object with Status200OK by specifying a content string, a contentType, and contentEncoding.

(Inherited from PageBase)
Content(String, String)

Creates a ContentResult object with Status200OK by specifying a content string and a content type.

(Inherited from PageBase)
Content(String)

Creates a ContentResult object with Status200OK by specifying a content string.

(Inherited from PageBase)
CreateTagHelper<TTagHelper>()

Creates and activates a ITagHelper.

(Inherited from RazorPageBase)
DefineSection(String, Func<Object,Task>)

Creates a named content section in the page that can be invoked in a Layout page using RenderSection or RenderSectionAsync

(Inherited from RazorPageBase)
DefineSection(String, RenderAsyncDelegate)

Creates a named content section in the page that can be invoked in a Layout page using RenderSection or RenderSectionAsync

(Inherited from RazorPageBase)
EndAddHtmlAttributeValues(TagHelperExecutionContext)

Ends adding html attribute values.

(Inherited from RazorPageBase)
EndContext() (Inherited from PageBase)
EndTagHelperWritingScope()

Ends the current writing scope that was started by calling StartTagHelperWritingScope(HtmlEncoder).

(Inherited from RazorPageBase)
EndWriteAttribute()

Ends writing an attribute.

(Inherited from RazorPageBase)
EndWriteTagHelperAttribute()

Ends the current writing scope that was started by calling BeginWriteTagHelperAttribute().

(Inherited from RazorPageBase)
EnsureRenderedBodyOrSections()

Verifies that all sections defined in PreviousSectionWriters were rendered, or the body was rendered if no sections were defined.

(Inherited from PageBase)
ExecuteAsync()

Renders the page and writes the output to the Writer.

(Inherited from RazorPageBase)
File(Byte[], String, String)

Returns a file with the specified fileContents as content (Status200OK), the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name.

(Inherited from PageBase)
File(Byte[], String)

Returns a file with the specified fileContents as content (Status200OK) and the specified contentType as the Content-Type.

(Inherited from PageBase)
File(Stream, String, String)

Returns a file in the specified fileStream (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name.

(Inherited from PageBase)
File(Stream, String)

Returns a file in the specified fileStream (Status200OK) with the specified contentType as the Content-Type.

(Inherited from PageBase)
File(String, String, String)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name.

(Inherited from PageBase)
File(String, String)

Returns the file specified by virtualPath (Status200OK) with the specified contentType as the Content-Type.

(Inherited from PageBase)
FlushAsync()

Invokes FlushAsync() on Output and Stream.FlushAsync on the response stream, writing out any buffered content to the Body.

(Inherited from RazorPageBase)
Forbid()

Creates a ForbidResult (Status403Forbidden by default).

(Inherited from PageBase)
Forbid(AuthenticationProperties, String[])

Creates a ForbidResult (Status403Forbidden by default) with the specified authentication schemes and properties.

(Inherited from PageBase)
Forbid(AuthenticationProperties)

Creates a ForbidResult (Status403Forbidden by default) with the specified properties.

(Inherited from PageBase)
Forbid(String[])

Creates a ForbidResult (Status403Forbidden by default) with the specified authentication schemes.

(Inherited from PageBase)
Href(String)

Returns a href for the given content path.

(Inherited from RazorPageBase)
InvalidTagHelperIndexerAssignment(String, String, String)

Format an error message about using an indexer when the tag helper property is null.

(Inherited from RazorPageBase)
LocalRedirect(String)

Creates a LocalRedirectResult object that redirects (Status302Found) to the specified local localUrl.

(Inherited from PageBase)
LocalRedirectPermanent(String)

Creates a LocalRedirectResult object with Permanent set to true (Status301MovedPermanently) using the specified localUrl.

(Inherited from PageBase)
LocalRedirectPermanentPreserveMethod(String)

Creates a LocalRedirectResult object with Permanent set to true and PreserveMethod set to true (Status308PermanentRedirect) using the specified localUrl.

(Inherited from PageBase)
LocalRedirectPreserveMethod(String)

Creates a LocalRedirectResult object with Permanent set to false and PreserveMethod set to true (Status307TemporaryRedirect) using the specified localUrl.

(Inherited from PageBase)
NotFound()

Creates an NotFoundResult that produces a Status404NotFound response.

(Inherited from PageBase)
NotFound(Object)

Creates an NotFoundObjectResult that produces a Status404NotFound response.

(Inherited from PageBase)
Page()

Creates a PageResult object that renders this page as a view to the response.

(Inherited from PageBase)
Partial(String, Object)

Creates a PartialViewResult by specifying the name of a partial to render and the model object.

(Inherited from PageBase)
Partial(String)

Creates a PartialViewResult by specifying the name of a partial to render.

(Inherited from PageBase)
PhysicalFile(String, String, String)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type and the specified fileDownloadName as the suggested file name.

(Inherited from PageBase)
PhysicalFile(String, String)

Returns the file specified by physicalPath (Status200OK) with the specified contentType as the Content-Type.

(Inherited from PageBase)
PopWriter()

Return a text writer from the stack.

(Inherited from RazorPageBase)
PushWriter(TextWriter)

Puts a text writer on the stack.

(Inherited from RazorPageBase)
Redirect(String)

Creates a RedirectResult object that redirects to the specified url.

(Inherited from PageBase)
RedirectPermanent(String)

Creates a RedirectResult object with Permanent set to true (Status301MovedPermanently) using the specified url.

(Inherited from PageBase)
RedirectPermanentPreserveMethod(String)

Creates a RedirectResult object with Permanent set to true and PreserveMethod set to true (Status308PermanentRedirect) using the specified url.

(Inherited from PageBase)
RedirectPreserveMethod(String)

Creates a RedirectResult object with Permanent set to false and PreserveMethod set to true (Status307TemporaryRedirect) using the specified url.

(Inherited from PageBase)
RedirectToAction(String, Object)

Redirects (Status302Found) to the specified action using the actionName and routeValues.

(Inherited from PageBase)
RedirectToAction(String, String, Object, String)

Redirects (Status302Found) to the specified action using the specified actionName, controllerName, routeValues, and fragment.

(Inherited from PageBase)
RedirectToAction(String, String, Object)

Redirects (Status302Found) to the specified action using the specified actionName, controllerName, and routeValues.

(Inherited from PageBase)
RedirectToAction(String, String, String)

Redirects (Status302Found) to the specified action using the specified actionName, controllerName, and fragment.

(Inherited from PageBase)
RedirectToAction(String, String)

Redirects (Status302Found) to the specified action using the actionName and the controllerName.

(Inherited from PageBase)
RedirectToAction(String)

Redirects (Status302Found) to the specified action using the actionName.

(Inherited from PageBase)
RedirectToActionPermanent(String, Object)

Redirects (Status301MovedPermanently) to the specified action with Permanent set to true using the specified actionName and routeValues.

(Inherited from PageBase)
RedirectToActionPermanent(String, String, Object, String)

Redirects (Status301MovedPermanently) to the specified action with Permanent set to true using the specified actionName, controllerName, routeValues, and fragment.

(Inherited from PageBase)
RedirectToActionPermanent(String, String, Object)

Redirects (Status301MovedPermanently) to the specified action with Permanent set to true using the specified actionName, controllerName, and routeValues.

(Inherited from PageBase)
RedirectToActionPermanent(String, String, String)

Redirects (Status301MovedPermanently) to the specified action with Permanent set to true using the specified actionName, controllerName, and fragment.

(Inherited from PageBase)
RedirectToActionPermanent(String, String)

Redirects (Status301MovedPermanently) to the specified action with Permanent set to true using the specified actionName and controllerName.

(Inherited from PageBase)
RedirectToActionPermanent(String)

Redirects (Status301MovedPermanently) to the specified action with Permanent set to true using the specified actionName.

(Inherited from PageBase)
RedirectToActionPermanentPreserveMethod(String, String, Object, String)

Redirects (Status308PermanentRedirect) to the specified action with Permanent set to true and PreserveMethod set to true, using the specified actionName, controllerName, routeValues, and fragment.

(Inherited from PageBase)
RedirectToActionPreserveMethod(String, String, Object, String)

Redirects (Status307TemporaryRedirect) to the specified action with Permanent set to false and PreserveMethod set to true, using the specified actionName, controllerName, routeValues, and fragment.

(Inherited from PageBase)
RedirectToPage()

Redirects (Status302Found) to the current page.

(Inherited from PageBase)
RedirectToPage(Object)

Redirects (Status302Found) to the current page with the specified routeValues.

(Inherited from PageBase)
RedirectToPage(String, Object)

Redirects (Status302Found) to the specified pageName using the specified routeValues.

(Inherited from PageBase)
RedirectToPage(String, String, Object, String)

Redirects (Status302Found) to the specified pageName using the specified routeValues and fragment.

(Inherited from PageBase)
RedirectToPage(String, String, String)

Redirects (Status302Found) to the specified pageName using the specified fragment.

(Inherited from PageBase)
RedirectToPage(String, String)

Redirects (Status302Found) to the specified pageName using the specified pageHandler.

(Inherited from PageBase)
RedirectToPage(String)

Redirects (Status302Found) to the specified pageName.

(Inherited from PageBase)
RedirectToPagePermanent(String, Object)

Redirects (Status301MovedPermanently) to the specified pageName using the specified routeValues.

(Inherited from PageBase)
RedirectToPagePermanent(String, String, Object, String)

Redirects (Status301MovedPermanently) to the specified pageName using the specified routeValues and fragment.

(Inherited from PageBase)
RedirectToPagePermanent(String, String, Object)

Redirects (Status301MovedPermanently) to the specified pageName using the specified routeValues.

(Inherited from PageBase)
RedirectToPagePermanent(String, String, String)

Redirects (Status301MovedPermanently) to the specified pageName using the specified fragment.

(Inherited from PageBase)
RedirectToPagePermanent(String, String)

Redirects (Status301MovedPermanently) to the specified pageName using the specified pageHandler.

(Inherited from PageBase)
RedirectToPagePermanent(String)

Redirects (Status301MovedPermanently) to the specified pageName.

(Inherited from PageBase)
RedirectToPagePermanentPreserveMethod(String, String, Object, String)

Redirects (Status308PermanentRedirect) to the specified route with Permanent set to true and PreserveMethod set to true, using the specified pageName, routeValues, and fragment.

(Inherited from PageBase)
RedirectToPagePreserveMethod(String, String, Object, String)

Redirects (Status307TemporaryRedirect) to the specified page with Permanent set to false and PreserveMethod set to true, using the specified pageName, routeValues, and fragment.

(Inherited from PageBase)
RedirectToRoute(Object)

Redirects (Status302Found) to the specified route using the specified routeValues.

(Inherited from PageBase)
RedirectToRoute(String, Object, String)

Redirects (Status302Found) to the specified route using the specified routeName, routeValues, and fragment.

(Inherited from PageBase)
RedirectToRoute(String, Object)

Redirects (Status302Found) to the specified route using the specified routeName and routeValues.

(Inherited from PageBase)
RedirectToRoute(String, String)

Redirects (Status302Found) to the specified route using the specified routeName and fragment.

(Inherited from PageBase)
RedirectToRoute(String)

Redirects (Status302Found) to the specified route using the specified routeName.

(Inherited from PageBase)
RedirectToRoutePermanent(Object)

Redirects (Status301MovedPermanently) to the specified route with Permanent set to true using the specified routeValues.

(Inherited from PageBase)
RedirectToRoutePermanent(String, Object, String)

Redirects (Status301MovedPermanently) to the specified route with Permanent set to true using the specified routeName, routeValues, and fragment.

(Inherited from PageBase)
RedirectToRoutePermanent(String, Object)

Redirects (Status301MovedPermanently) to the specified route with Permanent set to true using the specified routeName and routeValues.

(Inherited from PageBase)
RedirectToRoutePermanent(String, String)

Redirects (Status301MovedPermanently) to the specified route with Permanent set to true using the specified routeName and fragment.

(Inherited from PageBase)
RedirectToRoutePermanent(String)

Redirects (Status301MovedPermanently) to the specified route with Permanent set to true using the specified routeName.

(Inherited from PageBase)
RedirectToRoutePermanentPreserveMethod(String, Object, String)

Redirects (Status308PermanentRedirect) to the specified route with Permanent set to true and PreserveMethod set to true, using the specified routeName, routeValues, and fragment.

(Inherited from PageBase)
RedirectToRoutePreserveMethod(String, Object, String)

Redirects (Status307TemporaryRedirect) to the specified route with Permanent set to false and PreserveMethod set to true, using the specified routeName, routeValues, and fragment.

(Inherited from PageBase)
SetAntiforgeryCookieAndHeader()

Sets antiforgery cookie and X-Frame-Options header on the response.

(Inherited from RazorPageBase)
SignIn(ClaimsPrincipal, AuthenticationProperties, String)

Creates a SignInResult with the specified authentication scheme and properties.

(Inherited from PageBase)
SignIn(ClaimsPrincipal, String)

Creates a SignInResult with the specified authentication scheme.

(Inherited from PageBase)
SignOut(AuthenticationProperties, String[])

Creates a SignOutResult with the specified authentication schemes and properties.

(Inherited from PageBase)
SignOut(String[])

Creates a SignOutResult with the specified authentication schemes.

(Inherited from PageBase)
StartTagHelperWritingScope(HtmlEncoder)

Starts a new writing scope and optionally overrides HtmlEncoder within that scope.

(Inherited from RazorPageBase)
StatusCode(Int32, Object)

Creates a ObjectResult object by specifying a statusCode and value

(Inherited from PageBase)
StatusCode(Int32)

Creates a StatusCodeResult object by specifying a statusCode.

(Inherited from PageBase)
TryUpdateModelAsync(Object, Type, String, IValueProvider, Func<ModelMetadata,Boolean>)

Updates the specified model instance using the valueProvider and a prefix.

(Inherited from PageBase)
TryUpdateModelAsync(Object, Type, String)

Updates the specified model instance using values from the Page's current IValueProvider and a prefix.

(Inherited from PageBase)
TryUpdateModelAsync<TModel>(TModel, String, Expression<Func<TModel,Object>>[])

Updates the specified model instance using values from the Page's current IValueProvider and a prefix.

(Inherited from PageBase)
TryUpdateModelAsync<TModel>(TModel, String, Func<ModelMetadata,Boolean>)

Updates the specified model instance using values from the Page's current IValueProvider and a prefix.

(Inherited from PageBase)
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Expression<Func<TModel,Object>>[])

Updates the specified model instance using the valueProvider and a prefix.

(Inherited from PageBase)
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Func<ModelMetadata,Boolean>)

Updates the specified model instance using the valueProvider and a prefix.

(Inherited from PageBase)
TryUpdateModelAsync<TModel>(TModel, String, IValueProvider)

Updates the specified model instance using the valueProvider and a prefix.

(Inherited from PageBase)
TryUpdateModelAsync<TModel>(TModel, String)

Updates the specified model instance using values from the Page's current IValueProvider and a prefix.

(Inherited from PageBase)
TryUpdateModelAsync<TModel>(TModel)

Updates the specified model instance using values from the Page's current IValueProvider.

(Inherited from PageBase)
TryValidateModel(Object, String)

Validates the specified model instance.

(Inherited from PageBase)
TryValidateModel(Object)

Validates the specified model instance.

(Inherited from PageBase)
Unauthorized()

Creates an UnauthorizedResult that produces an Status401Unauthorized response.

(Inherited from PageBase)
ViewComponent(String, Object)

Creates a ViewComponentResult by specifying the name of a view component to render.

(Inherited from PageBase)
ViewComponent(String)

Creates a ViewComponentResult by specifying the name of a view component to render.

(Inherited from PageBase)
ViewComponent(Type, Object)

Creates a ViewComponentResult by specifying the Type of a view component to render.

(Inherited from PageBase)
ViewComponent(Type)

Creates a ViewComponentResult by specifying the Type of a view component to render.

(Inherited from PageBase)
Write(Object)

Writes the specified value with HTML encoding to Output.

(Inherited from RazorPageBase)
Write(String)

Writes the specified value with HTML encoding to Output.

(Inherited from RazorPageBase)
WriteAttributeValue(String, Int32, Object, Int32, Int32, Boolean)

Writes out an attribute value.

(Inherited from RazorPageBase)
WriteLiteral(Object)

Writes the specified value without HTML encoding to Output.

(Inherited from RazorPageBase)
WriteLiteral(String)

Writes the specified value without HTML encoding to Output.

(Inherited from RazorPageBase)

Applies to