RazorPage RazorPage Class

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

Syntax

Declaration

public abstract class RazorPage : IRazorPagePublic MustInherit Class RazorPage
    Implements IRazorPage

Inheritance Hierarchy

  • System.Object
    System.Object
  • RazorPage
    RazorPage

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

Properties summary

An HttpContext representing the current request execution.
Gets or sets a System.Diagnostics.DiagnosticSource.#ctor instance used to instrument the page execution.
Gets the System.Text.Encodings.Web.HtmlEncoder to use when this RazorPage handles non-IHtmlContent C# expressions.
Gets the System.IO.TextWriter that the page is writing output to.
Gets the ITempDataDictionary from the ViewContext.
Gets the System.Security.Claims.ClaimsPrincipal of the current logged in user.
Gets the dynamic view data dictionary.

Methods summary

Starts a new scope for writing ITagHelper attribute values.
Creates and activates a ITagHelper.
Creates a named content section in the page that can be invoked in a Layout page using RenderSection(String) or RenderSectionAsync(String, Boolean).
Ends the current writing scope that was started by calling StartTagHelperWritingScope(HtmlEncoder).
Ends the current writing scope that was started by calling BeginWriteTagHelperAttribute().
Invokes System.IO.TextWriter.FlushAsync() on Output and Stream.FlushAsync on the response stream, writing out any buffered content to the Body.
In a Razor layout page, ignores rendering the portion of a content page that is not within a named section.
In layout pages, ignores rendering the content of the section named sectionName.
Format an error message about using an indexer when the tag helper property is null.
Returns a value that indicates whether the specified section is defined in the content page.
In a Razor layout page, renders the portion of a content page that is not within a named section.
In layout pages, renders the content of the section named name.
In layout pages, renders the content of the section named name.
In layout pages, asynchronously renders the content of the section named name.
In layout pages, asynchronously renders the content of the section named name.
Sets antiforgery cookie and X-Frame-Options header on the response.
Starts a new writing scope and optionally overrides HtmlEncoder within that scope.
Writes the specified value with HTML encoding to Output.
Writes the specified value without HTML encoding to Output.
Writes the specified value without HTML encoding to the writer.
Writes the specified value without HTML encoding to Output.
Writes the specified value with HTML encoding to writer.
Writes the specified value with HTML encoding to writer.
Writes the specified value with HTML encoding to given writer.

Constructors

  • RazorPage()
    RazorPage()
    public RazorPage()Public Sub New

Properties

  • BodyContent
    BodyContent
    public IHtmlContent BodyContent { get; set; }Public Property BodyContent As IHtmlContent

    Property Value

  • Context
    Context
    An HttpContext representing the current request execution.
    public HttpContext Context { get; }Public ReadOnly Property Context As HttpContext

    Property Value

  • DiagnosticSource
    DiagnosticSource
    Gets or sets a System.Diagnostics.DiagnosticSource.#ctor instance used to instrument the page execution.
    public DiagnosticSource DiagnosticSource { get; set; }Public Property DiagnosticSource As DiagnosticSource

    Property Value

    • System.Diagnostics.DiagnosticSource
      System.Diagnostics.DiagnosticSource
  • HtmlEncoder
    HtmlEncoder
    Gets the System.Text.Encodings.Web.HtmlEncoder to use when this RazorPage handles non-IHtmlContent C# expressions.
    public HtmlEncoder HtmlEncoder { get; set; }Public Property HtmlEncoder As HtmlEncoder

    Property Value

    • System.Text.Encodings.Web.HtmlEncoder
      System.Text.Encodings.Web.HtmlEncoder
  • IsLayoutBeingRendered
    IsLayoutBeingRendered
    public bool IsLayoutBeingRendered { get; set; }Public Property IsLayoutBeingRendered As Boolean

    Property Value

    • System.Boolean
      System.Boolean
  • Layout
    Layout
    public string Layout { get; set; }Public Property Layout As String

    Property Value

    • System.String
      System.String
  • Output
    Output
    Gets the System.IO.TextWriter that the page is writing output to.
    public virtual TextWriter Output { get; }Public Overridable ReadOnly Property Output As TextWriter

    Property Value

    • System.IO.TextWriter
      System.IO.TextWriter
  • Path
    Path
    public string Path { get; set; }Public Property Path As String

    Property Value

    • System.String
      System.String
  • PreviousSectionWriters
    PreviousSectionWriters
    public IDictionary<string, RenderAsyncDelegate> PreviousSectionWriters { get; set; }Public Property PreviousSectionWriters As IDictionary(Of String, RenderAsyncDelegate)

    Property Value

  • SectionWriters
    SectionWriters
    public IDictionary<string, RenderAsyncDelegate> SectionWriters { get; }Public ReadOnly Property SectionWriters As IDictionary(Of String, RenderAsyncDelegate)

    Property Value

  • TempData
    TempData
    Gets the ITempDataDictionary from the ViewContext.
    public ITempDataDictionary TempData { get; }Public ReadOnly Property TempData As ITempDataDictionary

    Property Value

    Remarks

    Returns null if ViewContext is null.
  • User
    User
    Gets the System.Security.Claims.ClaimsPrincipal of the current logged in user.
    public virtual ClaimsPrincipal User { get; }Public Overridable ReadOnly Property User As ClaimsPrincipal

    Property Value

    • System.Security.Claims.ClaimsPrincipal
      System.Security.Claims.ClaimsPrincipal
  • ViewBag
    ViewBag
    Gets the dynamic view data dictionary.
    public dynamic ViewBag { get; }Public ReadOnly Property ViewBag As Object

    Property Value

    • System.Object
      System.Object
  • ViewContext
    ViewContext
    public ViewContext ViewContext { get; set; }Public Property ViewContext As ViewContext

    Property Value

Methods

  • AddHtmlAttributeValue(String, Int32, Object, Int32, Int32, Boolean)
    AddHtmlAttributeValue(String, Int32, Object, Int32, Int32, Boolean)
    public void AddHtmlAttributeValue(string prefix, int prefixOffset, object value, int valueOffset, int valueLength, bool isLiteral)Public Sub AddHtmlAttributeValue(prefix As String, prefixOffset As Integer, value As Object, valueOffset As Integer, valueLength As Integer, isLiteral As Boolean)

    Parameters

    • prefix
      System.String
      System.String
    • prefixOffset
      System.Int32
      System.Int32
    • value
      System.Object
      System.Object
    • valueOffset
      System.Int32
      System.Int32
    • valueLength
      System.Int32
      System.Int32
    • isLiteral
      System.Boolean
      System.Boolean
  • BeginAddHtmlAttributeValues(TagHelperExecutionContext, String, Int32, HtmlAttributeValueStyle)
    BeginAddHtmlAttributeValues(TagHelperExecutionContext, String, Int32, HtmlAttributeValueStyle)
    public void BeginAddHtmlAttributeValues(TagHelperExecutionContext executionContext, string attributeName, int attributeValuesCount, HtmlAttributeValueStyle attributeValueStyle)Public Sub BeginAddHtmlAttributeValues(executionContext As TagHelperExecutionContext, attributeName As String, attributeValuesCount As Integer, attributeValueStyle As HtmlAttributeValueStyle)

    Parameters

  • BeginContext(Int32, Int32, Boolean)
    BeginContext(Int32, Int32, Boolean)
    public void BeginContext(int position, int length, bool isLiteral)Public Sub BeginContext(position As Integer, length As Integer, isLiteral As Boolean)

    Parameters

    • position
      System.Int32
      System.Int32
    • length
      System.Int32
      System.Int32
    • isLiteral
      System.Boolean
      System.Boolean
  • BeginWriteAttribute(String, String, Int32, String, Int32, Int32)
    BeginWriteAttribute(String, String, Int32, String, Int32, Int32)
    public virtual void BeginWriteAttribute(string name, string prefix, int prefixOffset, string suffix, int suffixOffset, int attributeValuesCount)Public Overridable Sub BeginWriteAttribute(name As String, prefix As String, prefixOffset As Integer, suffix As String, suffixOffset As Integer, attributeValuesCount As Integer)

    Parameters

    • name
      System.String
      System.String
    • prefix
      System.String
      System.String
    • prefixOffset
      System.Int32
      System.Int32
    • suffix
      System.String
      System.String
    • suffixOffset
      System.Int32
      System.Int32
    • attributeValuesCount
      System.Int32
      System.Int32
  • BeginWriteAttributeTo(TextWriter, String, String, Int32, String, Int32, Int32)
    BeginWriteAttributeTo(TextWriter, String, String, Int32, String, Int32, Int32)
    public virtual void BeginWriteAttributeTo(TextWriter writer, string name, string prefix, int prefixOffset, string suffix, int suffixOffset, int attributeValuesCount)Public Overridable Sub BeginWriteAttributeTo(writer As TextWriter, name As String, prefix As String, prefixOffset As Integer, suffix As String, suffixOffset As Integer, attributeValuesCount As Integer)

    Parameters

    • writer
      System.IO.TextWriter
      System.IO.TextWriter
    • name
      System.String
      System.String
    • prefix
      System.String
      System.String
    • prefixOffset
      System.Int32
      System.Int32
    • suffix
      System.String
      System.String
    • suffixOffset
      System.Int32
      System.Int32
    • attributeValuesCount
      System.Int32
      System.Int32
  • BeginWriteTagHelperAttribute()
    BeginWriteTagHelperAttribute()
    Starts a new scope for writing ITagHelper attribute values.
    public void BeginWriteTagHelperAttribute()Public Sub BeginWriteTagHelperAttribute

    Remarks

    All writes to the Output or Writer after calling this method will be buffered until EndWriteTagHelperAttribute() is called. The content will be buffered using a shared System.IO.StringWriter within this RazorPage Nesting of BeginWriteTagHelperAttribute() and EndWriteTagHelperAttribute() method calls is not supported.
  • CreateTagHelper<TTagHelper>()
    CreateTagHelper(Of TTagHelper)()
    Creates and activates a ITagHelper.
    public TTagHelper CreateTagHelper<TTagHelper>()where TTagHelper : ITagHelperPublic Function CreateTagHelper(Of TTagHelper As ITagHelper) As TTagHelper

    Returns

    Remarks

    TTagHelper must have a parameterless constructor.
  • DefineSection(String, RenderAsyncDelegate)
    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).
    public void DefineSection(string name, RenderAsyncDelegate section)Public Sub DefineSection(name As String, section As RenderAsyncDelegate)

    Parameters

  • EndAddHtmlAttributeValues(TagHelperExecutionContext)
    EndAddHtmlAttributeValues(TagHelperExecutionContext)
    public void EndAddHtmlAttributeValues(TagHelperExecutionContext executionContext)Public Sub EndAddHtmlAttributeValues(executionContext As TagHelperExecutionContext)

    Parameters

  • EndContext()
    EndContext()
    public void EndContext()Public Sub
  • EndTagHelperWritingScope()
    EndTagHelperWritingScope()
    Ends the current writing scope that was started by calling StartTagHelperWritingScope(HtmlEncoder).
    public TagHelperContent EndTagHelperWritingScope()Public Function EndTagHelperWritingScope As TagHelperContent

    Returns

  • EndWriteAttribute()
    EndWriteAttribute()
    public virtual void EndWriteAttribute()Public Overridable Sub
  • EndWriteAttributeTo(TextWriter)
    EndWriteAttributeTo(TextWriter)
    public virtual void EndWriteAttributeTo(TextWriter writer)Public Overridable Sub EndWriteAttributeTo(writer As TextWriter)

    Parameters

    • writer
      System.IO.TextWriter
      System.IO.TextWriter
  • EndWriteTagHelperAttribute()
    EndWriteTagHelperAttribute()
    Ends the current writing scope that was started by calling BeginWriteTagHelperAttribute().
    public string EndWriteTagHelperAttribute()Public Function EndWriteTagHelperAttribute As String

    Returns

    • System.String
      System.String
      The content buffered by the shared System.IO.StringWriter of this RazorPage.

    Remarks

    This method assumes that there will be no nesting of BeginWriteTagHelperAttribute() and EndWriteTagHelperAttribute() method calls.
  • EnsureRenderedBodyOrSections()
    EnsureRenderedBodyOrSections()
    public void EnsureRenderedBodyOrSections()Public Sub EnsureRenderedBodyOrSections
  • ExecuteAsync()
    ExecuteAsync()
    public abstract Task ExecuteAsync()Public MustOverride Function ExecuteAsync As Task

    Returns

    • System.Threading.Tasks.Task
      System.Threading.Tasks.Task
  • FlushAsync()
    FlushAsync()
    Invokes System.IO.TextWriter.FlushAsync() on Output and Stream.FlushAsync on the response stream, writing out any buffered content to the Body.
    public Task<HtmlString> FlushAsync()Public Function FlushAsync As Task(Of HtmlString)

    Returns

    • System.Threading.Tasks.Task<TResult><HtmlString>
      System.Threading.Tasks.Task<TResult>(Of HtmlString)
      A System.Threading.Tasks.Task<TResult> that represents the asynchronous flush operation and on completion returns Empty.

    Remarks

    The value returned is a token value that allows FlushAsync to work directly in an HTML section. However the value does not represent the rendered content. This method also writes out headers, so any modifications to headers must be done before FlushAsync() is called. For example, call SetAntiforgeryCookieAndHeader() to send antiforgery cookie token and X-Frame-Options header to client before this method flushes headers out.
  • Href(String)
    Href(String)
    public virtual string Href(string contentPath)Public Overridable Function Href(contentPath As String) As String

    Parameters

    • contentPath
      System.String
      System.String

    Returns

    • System.String
      System.String
  • IgnoreBody()
    IgnoreBody()
    In a Razor layout page, ignores rendering the portion of a content page that is not within a named section.
    public void IgnoreBody()Public Sub IgnoreBody
  • IgnoreSection(String)
    IgnoreSection(String)
    In layout pages, ignores rendering the content of the section named sectionName.
    public void IgnoreSection(string sectionName)Public Sub IgnoreSection(sectionName As String)

    Parameters

    • sectionName
      System.String
      System.String
      The section to ignore.
  • InvalidTagHelperIndexerAssignment(String, String, String)
    InvalidTagHelperIndexerAssignment(String, String, String)
    Format an error message about using an indexer when the tag helper property is null.
    public static string InvalidTagHelperIndexerAssignment(string attributeName, string tagHelperTypeName, string propertyName)Public Shared Function InvalidTagHelperIndexerAssignment(attributeName As String, tagHelperTypeName As String, propertyName As String) As String

    Parameters

    • attributeName
      System.String
      System.String
      Name of the HTML attribute associated with the indexer.
    • tagHelperTypeName
      System.String
      System.String
      Full name of the tag helper System.Type.
    • propertyName
      System.String
      System.String
      Dictionary property in the tag helper.

    Returns

    • System.String
      System.String
      An error message about using an indexer when the tag helper property is null.
  • IsSectionDefined(String)
    IsSectionDefined(String)
    Returns a value that indicates whether the specified section is defined in the content page.
    public bool IsSectionDefined(string name)Public Function IsSectionDefined(name As String) As Boolean

    Parameters

    • name
      System.String
      System.String
      The section name to search for.

    Returns

    • System.Boolean
      System.Boolean
      true if the specified section is defined in the content page; otherwise, false.
  • RenderBody()
    RenderBody()
    In a Razor layout page, renders the portion of a content page that is not within a named section.
    protected virtual IHtmlContent RenderBody()Protected Overridable Function RenderBody As IHtmlContent

    Returns

  • RenderSection(String)
    RenderSection(String)
    In layout pages, renders the content of the section named name.
    public HtmlString RenderSection(string name)Public Function RenderSection(name As String) As HtmlString

    Parameters

    • name
      System.String
      System.String
      The name of the section to render.

    Returns

    Remarks

    The method writes to the Output and the value returned is a token value that allows the Write (produced due to @RenderSection(..)) to succeed. However the value does not represent the rendered content.
  • RenderSection(String, Boolean)
    RenderSection(String, Boolean)
    In layout pages, renders the content of the section named name.
    public HtmlString RenderSection(string name, bool required)Public Function RenderSection(name As String, required As Boolean) As HtmlString

    Parameters

    • name
      System.String
      System.String
      The section to render.
    • required
      System.Boolean
      System.Boolean
      Indicates if this section must be rendered.

    Returns

    Remarks

    The method writes to the Output and the value returned is a token value that allows the Write (produced due to @RenderSection(..)) to succeed. However the value does not represent the rendered content.
  • RenderSectionAsync(String)
    RenderSectionAsync(String)
    In layout pages, asynchronously renders the content of the section named name.
    public Task<HtmlString> RenderSectionAsync(string name)Public Function RenderSectionAsync(name As String) As Task(Of HtmlString)

    Parameters

    • name
      System.String
      System.String
      The section to render.

    Returns

    • System.Threading.Tasks.Task<TResult><HtmlString>
      System.Threading.Tasks.Task<TResult>(Of HtmlString)
      A System.Threading.Tasks.Task<TResult> that on completion returns Empty that allows the Write(Object) call to succeed.

    Remarks

    The method writes to the Output and the value returned is a token value that allows the Write (produced due to @RenderSection(..)) to succeed. However the value does not represent the rendered content.
  • RenderSectionAsync(String, Boolean)
    RenderSectionAsync(String, Boolean)
    In layout pages, asynchronously renders the content of the section named name.
    public Task<HtmlString> RenderSectionAsync(string name, bool required)Public Function RenderSectionAsync(name As String, required As Boolean) As Task(Of HtmlString)

    Parameters

    • name
      System.String
      System.String
      The section to render.
    • required
      System.Boolean
      System.Boolean
      Indicates the name section must be registered (using @section) in the page.

    Returns

    • System.Threading.Tasks.Task<TResult><HtmlString>
      System.Threading.Tasks.Task<TResult>(Of HtmlString)
      A System.Threading.Tasks.Task<TResult> that on completion returns Empty that allows the Write(Object) call to succeed.

    Exceptions

    • System.InvalidOperationException
      System.InvalidOperationException
      if required is true and the section was not registered using the @section in the Razor page.

    Remarks

    The method writes to the Output and the value returned is a token value that allows the Write (produced due to @RenderSection(..)) to succeed. However the value does not represent the rendered content.
  • SetAntiforgeryCookieAndHeader()
    SetAntiforgeryCookieAndHeader()
    Sets antiforgery cookie and X-Frame-Options header on the response.
    public virtual HtmlString SetAntiforgeryCookieAndHeader()Public Overridable Function SetAntiforgeryCookieAndHeader As HtmlString

    Returns

    Remarks

    Call this method to send antiforgery cookie token and X-Frame-Options header to client before FlushAsync() flushes the headers.
  • StartTagHelperWritingScope(HtmlEncoder)
    StartTagHelperWritingScope(HtmlEncoder)
    Starts a new writing scope and optionally overrides HtmlEncoder within that scope.
    public void StartTagHelperWritingScope(HtmlEncoder encoder)Public Sub StartTagHelperWritingScope(encoder As HtmlEncoder)

    Parameters

    • encoder
      System.Text.Encodings.Web.HtmlEncoder
      System.Text.Encodings.Web.HtmlEncoder
      The System.Text.Encodings.Web.HtmlEncoder to use when this RazorPage handles non-IHtmlContent C# expressions. If null, does not change HtmlEncoder.

    Remarks

    All writes to the Output or Writer after calling this method will be buffered until EndTagHelperWritingScope() is called.
  • Write(Object)
    Write(Object)
    Writes the specified value with HTML encoding to Output.
    public virtual void Write(object value)Public Overridable Sub Write(value As Object)

    Parameters

    • value
      System.Object
      System.Object
      The System.Object to write.
  • WriteAttributeValue(String, Int32, Object, Int32, Int32, Boolean)
    WriteAttributeValue(String, Int32, Object, Int32, Int32, Boolean)
    public void WriteAttributeValue(string prefix, int prefixOffset, object value, int valueOffset, int valueLength, bool isLiteral)Public Sub WriteAttributeValue(prefix As String, prefixOffset As Integer, value As Object, valueOffset As Integer, valueLength As Integer, isLiteral As Boolean)

    Parameters

    • prefix
      System.String
      System.String
    • prefixOffset
      System.Int32
      System.Int32
    • value
      System.Object
      System.Object
    • valueOffset
      System.Int32
      System.Int32
    • valueLength
      System.Int32
      System.Int32
    • isLiteral
      System.Boolean
      System.Boolean
  • WriteAttributeValueTo(TextWriter, String, Int32, Object, Int32, Int32, Boolean)
    WriteAttributeValueTo(TextWriter, String, Int32, Object, Int32, Int32, Boolean)
    public void WriteAttributeValueTo(TextWriter writer, string prefix, int prefixOffset, object value, int valueOffset, int valueLength, bool isLiteral)Public Sub WriteAttributeValueTo(writer As TextWriter, prefix As String, prefixOffset As Integer, value As Object, valueOffset As Integer, valueLength As Integer, isLiteral As Boolean)

    Parameters

    • writer
      System.IO.TextWriter
      System.IO.TextWriter
    • prefix
      System.String
      System.String
    • prefixOffset
      System.Int32
      System.Int32
    • value
      System.Object
      System.Object
    • valueOffset
      System.Int32
      System.Int32
    • valueLength
      System.Int32
      System.Int32
    • isLiteral
      System.Boolean
      System.Boolean
  • WriteLiteral(Object)
    WriteLiteral(Object)
    Writes the specified value without HTML encoding to Output.
    public virtual void WriteLiteral(object value)Public Overridable Sub WriteLiteral(value As Object)

    Parameters

    • value
      System.Object
      System.Object
      The System.Object to write.
  • WriteLiteralTo(TextWriter, Object)
    WriteLiteralTo(TextWriter, Object)
    Writes the specified value without HTML encoding to the writer.
    public virtual void WriteLiteralTo(TextWriter writer, object value)Public Overridable Sub WriteLiteralTo(writer As TextWriter, value As Object)

    Parameters

    • writer
      System.IO.TextWriter
      System.IO.TextWriter
      The System.IO.TextWriter instance to write to.
    • value
      System.Object
      System.Object
      The System.Object to write.
  • WriteLiteralTo(TextWriter, String)
    WriteLiteralTo(TextWriter, String)
    Writes the specified value without HTML encoding to Output.
    public virtual void WriteLiteralTo(TextWriter writer, string value)Public Overridable Sub WriteLiteralTo(writer As TextWriter, value As String)

    Parameters

    • writer
      System.IO.TextWriter
      System.IO.TextWriter
      The System.IO.TextWriter instance to write to.
    • value
      System.String
      System.String
      The System.String to write.
  • WriteTo(TextWriter, Object)
    WriteTo(TextWriter, Object)
    Writes the specified value with HTML encoding to writer.
    public virtual void WriteTo(TextWriter writer, object value)Public Overridable Sub WriteTo(writer As TextWriter, value As Object)

    Parameters

    • writer
      System.IO.TextWriter
      System.IO.TextWriter
      The System.IO.TextWriter instance to write to.
    • value
      System.Object
      System.Object
      The System.Object to write.

    Remarks

    values of type IHtmlContent are written using WriteTo(TextWriter, HtmlEncoder). For all other types, the encoded result of System.Object.ToString() is written to the writer.
  • WriteTo(TextWriter, String)
    WriteTo(TextWriter, String)
    Writes the specified value with HTML encoding to writer.
    public virtual void WriteTo(TextWriter writer, string value)Public Overridable Sub WriteTo(writer As TextWriter, value As String)

    Parameters

    • writer
      System.IO.TextWriter
      System.IO.TextWriter
      The System.IO.TextWriter instance to write to.
    • value
      System.String
      System.String
      The System.String to write.
  • WriteTo(TextWriter, HtmlEncoder, Object)
    WriteTo(TextWriter, HtmlEncoder, Object)
    Writes the specified value with HTML encoding to given writer.
    public static void WriteTo(TextWriter writer, HtmlEncoder encoder, object value)Public Shared Sub WriteTo(writer As TextWriter, encoder As HtmlEncoder, value As Object)

    Parameters

    • writer
      System.IO.TextWriter
      System.IO.TextWriter
      The System.IO.TextWriter instance to write to.
    • encoder
      System.Text.Encodings.Web.HtmlEncoder
      System.Text.Encodings.Web.HtmlEncoder
      The System.Text.Encodings.Web.HtmlEncoder to use when encoding value.
    • value
      System.Object
      System.Object
      The System.Object to write.

    Remarks

    values of type IHtmlContent are written using WriteTo(TextWriter, HtmlEncoder). For all other types, the encoded result of System.Object.ToString() is written to the writer.

Details

Assembly

Microsoft.AspNetCore.Mvc.Razor.dll