RazorPage<TModel> Class

Definition

Represents the properties and methods that are needed in order to render a view that uses Razor syntax.

generic <typename TModel>
public ref class RazorPage abstract : Microsoft::AspNetCore::Mvc::Razor::RazorPage
public abstract class RazorPage<TModel> : Microsoft.AspNetCore.Mvc.Razor.RazorPage
type RazorPage<'Model> = class
    inherit RazorPage
Public MustInherit Class RazorPage(Of TModel)
Inherits RazorPage

Type Parameters

TModel

The type of the view data model.

Inheritance
RazorPage<TModel>
Inheritance
RazorPage<TModel>

Constructors

RazorPage<TModel>()

Properties

BodyContent

Gets or sets the body content.

(Inherited from RazorPage)
Context

An HttpContext representing the current request execution.

(Inherited from RazorPage)
DiagnosticSource

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

(Inherited from RazorPage)
HtmlEncoder

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

(Inherited from RazorPage)
IsLayoutBeingRendered

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

(Inherited from RazorPage)
Layout

Gets or sets the path of a layout page.

(Inherited from RazorPage)
Model

Gets the Model property of the ViewData property.

Output

Gets the TextWriter that the page is writing output to.

(Inherited from RazorPage)
Path

Gets the application base relative path to the page.

(Inherited from RazorPage)
PreviousSectionWriters

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

(Inherited from RazorPage)
SectionWriters

Gets the sections that are defined by this page.

(Inherited from RazorPage)
TempData

Gets the ITempDataDictionary from the ViewContext.

(Inherited from RazorPage)
User

Gets the ClaimsPrincipal of the current logged in user.

(Inherited from RazorPage)
ViewBag

Gets the dynamic view data dictionary.

(Inherited from RazorPage)
ViewContext

Gets or sets the view context of the rendering view.

(Inherited from RazorPage)
ViewData

Gets or sets the dictionary for view data.

Methods

AddHtmlAttributeValue(String, Int32, Object, Int32, Int32, Boolean) (Inherited from RazorPage)
BeginAddHtmlAttributeValues(TagHelperExecutionContext, String, Int32, HtmlAttributeValueStyle) (Inherited from RazorPage)
BeginContext(Int32, Int32, Boolean) (Inherited from RazorPage)
BeginWriteAttribute(String, String, Int32, String, Int32, Int32) (Inherited from RazorPage)
BeginWriteAttributeTo(TextWriter, String, String, Int32, String, Int32, Int32) (Inherited from RazorPage)
BeginWriteTagHelperAttribute()

Starts a new scope for writing ITagHelper attribute values.

(Inherited from RazorPage)
CreateTagHelper<TTagHelper>()

Creates and activates a ITagHelper.

(Inherited from RazorPage)
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(String) or RenderSectionAsync(String, Boolean).

(Inherited from RazorPage)
EndAddHtmlAttributeValues(TagHelperExecutionContext) (Inherited from RazorPage)
EndContext() (Inherited from RazorPage)
EndTagHelperWritingScope()

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

(Inherited from RazorPage)
EndWriteAttribute() (Inherited from RazorPage)
EndWriteAttributeTo(TextWriter) (Inherited from RazorPage)
EndWriteTagHelperAttribute()

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

(Inherited from RazorPage)
EnsureRenderedBodyOrSections()

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

(Inherited from RazorPage)
ExecuteAsync()

Renders the page and writes the output to the Writer.

(Inherited from RazorPage)
FlushAsync()

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

(Inherited from RazorPage)
Href(String) (Inherited from RazorPage)
IgnoreBody()

In a Razor layout page, ignores rendering the portion of a content page that is not within a named section.

(Inherited from RazorPage)
IgnoreSection(String)

In layout pages, ignores rendering the content of the section named sectionName.

(Inherited from RazorPage)
InvalidTagHelperIndexerAssignment(String, String, String)

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

(Inherited from RazorPageBase)
IsSectionDefined(String)

Returns a value that indicates whether the specified section is defined in the content page.

(Inherited from RazorPage)
PopWriter()

Return a text writer from the stack.

(Inherited from RazorPageBase)
PushWriter(TextWriter)

Puts a text writer on the stack.

(Inherited from RazorPageBase)
RenderBody()

In a Razor layout page, renders the portion of a content page that is not within a named section.

(Inherited from RazorPage)
RenderSection(String, Boolean)

In layout pages, renders the content of the section named name.

(Inherited from RazorPage)
RenderSection(String)

In layout pages, renders the content of the section named name.

(Inherited from RazorPage)
RenderSectionAsync(String, Boolean)

In layout pages, asynchronously renders the content of the section named name.

(Inherited from RazorPage)
RenderSectionAsync(String)

In layout pages, asynchronously renders the content of the section named name.

(Inherited from RazorPage)
SetAntiforgeryCookieAndHeader()

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

(Inherited from RazorPage)
StartTagHelperWritingScope(HtmlEncoder)

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

(Inherited from RazorPage)
Write(Object)

Writes the specified value with HTML encoding to Output.

(Inherited from RazorPage)
Write(String)

Writes the specified value with HTML encoding to Output.

(Inherited from RazorPageBase)
WriteAttributeValue(String, Int32, Object, Int32, Int32, Boolean) (Inherited from RazorPage)
WriteAttributeValueTo(TextWriter, String, Int32, Object, Int32, Int32, Boolean) (Inherited from RazorPage)
WriteLiteral(Object)

Writes the specified value without HTML encoding to Output.

(Inherited from RazorPage)
WriteLiteral(String)

Writes the specified value without HTML encoding to Output.

(Inherited from RazorPageBase)
WriteLiteralTo(TextWriter, Object)

Writes the specified value without HTML encoding to the writer.

(Inherited from RazorPage)
WriteLiteralTo(TextWriter, String)

Writes the specified value without HTML encoding to Output.

(Inherited from RazorPage)
WriteTo(TextWriter, Object)

Writes the specified value with HTML encoding to writer.

(Inherited from RazorPage)
WriteTo(TextWriter, String)

Writes the specified value with HTML encoding to writer.

(Inherited from RazorPage)

Applies to