Delen via


RazorPageBase Class

Definition

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

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

Constructors

RazorPageBase()

Properties

BodyContent

Gets or sets the body content.

DiagnosticSource

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

HtmlEncoder

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

IsLayoutBeingRendered

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

Layout

Gets or sets the path of a layout page.

Output

Gets the TextWriter that the page is writing output to.

Path

Gets the application base relative path to the page.

PreviousSectionWriters

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

SectionWriters

Gets the sections that are defined by this page.

TempData

Gets the ITempDataDictionary from the ViewContext.

User

Gets the ClaimsPrincipal of the current logged in user.

ViewBag

Gets the dynamic view data dictionary.

ViewContext

Gets or sets the view context of the rendering view.

Methods

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

Add an html attribute value.

BeginAddHtmlAttributeValues(TagHelperExecutionContext, String, Int32, HtmlAttributeValueStyle)

Begins adding html attribute values.

BeginContext(Int32, Int32, Boolean) System.Object.BeginContext(System.Int32,System.Int32,System.Boolean)
BeginWriteAttribute(String, String, Int32, String, Int32, Int32)

Begins writing out an attribute.

BeginWriteTagHelperAttribute()

Starts a new scope for writing ITagHelper attribute values.

CreateTagHelper<TTagHelper>()

Creates and activates a ITagHelper.

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

DefineSection(String, RenderAsyncDelegate)

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

EndAddHtmlAttributeValues(TagHelperExecutionContext)

Ends adding html attribute values.

EndContext() System.Object.EndContext
EndTagHelperWritingScope()

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

EndWriteAttribute()

Ends writing an attribute.

EndWriteTagHelperAttribute()

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

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.

FlushAsync()

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

Href(String)

Returns a href for the given content path.

InvalidTagHelperIndexerAssignment(String, String, String)

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

PopWriter()

Return a text writer from the stack.

PushWriter(TextWriter)

Puts a text writer on the stack.

SetAntiforgeryCookieAndHeader()

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

StartTagHelperWritingScope(HtmlEncoder)

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

Write(Object)

Writes the specified value with HTML encoding to Output.

Write(String)

Writes the specified value with HTML encoding to Output.

WriteAttributeValue(String, Int32, Object, Int32, Int32, Boolean)

Writes out an attribute value.

WriteLiteral(Object)

Writes the specified value without HTML encoding to Output.

WriteLiteral(String)

Writes the specified value without HTML encoding to Output.

Applies to