RazorPage Class

Definition

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

public ref class RazorPage abstract : Microsoft::AspNetCore::Mvc::Razor::IRazorPage
public ref class RazorPage abstract : Microsoft::AspNetCore::Mvc::Razor::RazorPageBase
public abstract class RazorPage : Microsoft.AspNetCore.Mvc.Razor.IRazorPage
public abstract class RazorPage : Microsoft.AspNetCore.Mvc.Razor.RazorPageBase
type RazorPage = class
    interface IRazorPage
type RazorPage = class
    inherit RazorPageBase
Public MustInherit Class RazorPage
Implements IRazorPage
Public MustInherit Class RazorPage
Inherits RazorPageBase
Inheritance
RazorPage
Inheritance
RazorPage
Derived
Implements

Constructors

RazorPage()

Properties

BodyContent

Gets or sets the body content.

BodyContent

Gets or sets the body content.

(Inherited from RazorPageBase)
Context

An HttpContext representing the current request execution.

DiagnosticSource

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

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.

HtmlEncoder

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

(Inherited from RazorPageBase)
IsLayoutBeingRendered

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

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.

Layout

Gets or sets the path of a layout page.

(Inherited from RazorPageBase)
Output

Gets the TextWriter that the page is writing output to.

Output

Gets the TextWriter that the page is writing output to.

(Inherited from RazorPageBase)
Path

Gets the application base relative path to the page.

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.

PreviousSectionWriters

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

(Inherited from RazorPageBase)
SectionWriters

Gets the sections that are defined by this page.

SectionWriters

Gets the sections that are defined by this page.

(Inherited from RazorPageBase)
TempData

Gets the ITempDataDictionary from the ViewContext.

TempData

Gets the ITempDataDictionary from the ViewContext.

(Inherited from RazorPageBase)
User

Gets the ClaimsPrincipal of the current logged in user.

User

Gets the ClaimsPrincipal of the current logged in user.

(Inherited from RazorPageBase)
ViewBag

Gets the dynamic view data dictionary.

ViewBag

Gets the dynamic view data dictionary.

(Inherited from RazorPageBase)
ViewContext

Gets or sets the view context of the rendering view.

ViewContext

Gets or sets the view context of the rendering view.

(Inherited from RazorPageBase)

Methods

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

Add an html attribute value.

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

Begins adding html attribute values.

(Inherited from RazorPageBase)
BeginContext(Int32, Int32, Boolean) System.Object.BeginContext(System.Int32,System.Int32,System.Boolean)
BeginWriteAttribute(String, String, Int32, String, Int32, Int32)
BeginWriteAttribute(String, String, Int32, String, Int32, Int32)

Begins writing out an attribute.

(Inherited from RazorPageBase)
BeginWriteAttributeTo(TextWriter, String, String, Int32, String, Int32, Int32)
BeginWriteTagHelperAttribute()

Starts a new scope for writing ITagHelper attribute values.

BeginWriteTagHelperAttribute()

Starts a new scope for writing ITagHelper attribute values.

(Inherited from RazorPageBase)
CreateTagHelper<TTagHelper>()

Creates and activates a ITagHelper.

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

EndAddHtmlAttributeValues(TagHelperExecutionContext)
EndAddHtmlAttributeValues(TagHelperExecutionContext)

Ends adding html attribute values.

(Inherited from RazorPageBase)
EndContext() System.Object.EndContext
EndTagHelperWritingScope()

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

EndTagHelperWritingScope()

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

(Inherited from RazorPageBase)
EndWriteAttribute()
EndWriteAttribute()

Ends writing an attribute.

(Inherited from RazorPageBase)
EndWriteAttributeTo(TextWriter)
EndWriteTagHelperAttribute()

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

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.

ExecuteAsync()

Renders the page and writes the output to the Writer.

ExecuteAsync()

Renders the page and writes the output to the Writer.

(Inherited from RazorPageBase)
FlushAsync()

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

FlushAsync()

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

(Inherited from RazorPageBase)
Href(String)
Href(String)

Returns a href for the given content path.

(Inherited from RazorPageBase)
IgnoreBody()

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

IgnoreSection(String)

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

InvalidTagHelperIndexerAssignment(String, String, String)

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

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.

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.

RenderSection(String)

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

RenderSection(String, Boolean)

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

RenderSectionAsync(String)

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

RenderSectionAsync(String, Boolean)

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

SetAntiforgeryCookieAndHeader()

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

SetAntiforgeryCookieAndHeader()

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

(Inherited from RazorPageBase)
StartTagHelperWritingScope(HtmlEncoder)

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

StartTagHelperWritingScope(HtmlEncoder)

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

(Inherited from RazorPageBase)
Write(Object)

Writes the specified value with HTML encoding to Output.

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)
WriteAttributeValue(String, Int32, Object, Int32, Int32, Boolean)

Writes out an attribute value.

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

Writes the specified value without HTML encoding to Output.

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)
WriteLiteralTo(TextWriter, Object)

Writes the specified value without HTML encoding to the writer.

WriteLiteralTo(TextWriter, String)

Writes the specified value without HTML encoding to Output.

WriteTo(TextWriter, HtmlEncoder, Object)

Writes the specified value with HTML encoding to given writer.

WriteTo(TextWriter, Object)

Writes the specified value with HTML encoding to writer.

WriteTo(TextWriter, String)

Writes the specified value with HTML encoding to writer.

Applies to