IRazorPage Interface

Summary

Represents properties and methods that are used by [Microsoft.AspNet.Mvc.Razor.RazorView](Microsoft.AspNet.Mvc.Razor.RazorView.yml) for execution.

Syntax

public interface IRazorPage

GitHub

View on GitHub

interface Microsoft.AspNet.Mvc.Razor.IRazorPage

Properties

IsLayoutBeingRendered()

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

Return type:System.Boolean
bool IsLayoutBeingRendered { get; set; }
IsPartial()

Gets or sets a value that determines if the current instance of [Microsoft.AspNet.Mvc.Razor.IRazorPage](Microsoft.AspNet.Mvc.Razor.IRazorPage.yml) is being executed from a partial view.

Return type:System.Boolean
bool IsPartial { get; set; }
Layout()

Gets or sets the path of a layout page.

Return type:System.String
string Layout { get; set; }
PageExecutionContext()

Gets or sets a [Microsoft.AspNet.PageExecutionInstrumentation.IPageExecutionContext]() instance used to instrument the page execution.

Return type:Microsoft.AspNet.PageExecutionInstrumentation.IPageExecutionContext
IPageExecutionContext PageExecutionContext { get; set; }
Path()

Gets the application base relative path to the page.

Return type:System.String
string Path { get; set; }
PreviousSectionWriters()

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

Return type:System.Collections.Generic.IDictionary{System.String,Microsoft.AspNet.Mvc.Razor.RenderAsyncDelegate}
IDictionary<string, RenderAsyncDelegate> PreviousSectionWriters { get; set; }
RenderBodyDelegate()

Gets or sets the action invoked to render the body.

Return type:System.Action{System.IO.TextWriter}
Action<TextWriter> RenderBodyDelegate { get; set; }
SectionWriters()

Gets the sections that are defined by this page.

Return type:System.Collections.Generic.IDictionary{System.String,Microsoft.AspNet.Mvc.Razor.RenderAsyncDelegate}
IDictionary<string, RenderAsyncDelegate> SectionWriters { get; }
ViewContext()

Gets or sets the view context of the renderign view.

Return type:Microsoft.AspNet.Mvc.ViewContext
ViewContext ViewContext { get; set; }

Methods

Microsoft.AspNet.Mvc.Razor.IRazorPage.EnsureRenderedBodyOrSections()

Verifies that all sections defined in [Microsoft.AspNet.Mvc.Razor.IRazorPage.PreviousSectionWriters](Microsoft.AspNet.Mvc.Razor.IRazorPage.yml) were rendered, or the body was rendered if no sections were defined.

void EnsureRenderedBodyOrSections()
Microsoft.AspNet.Mvc.Razor.IRazorPage.ExecuteAsync()

Renders the page and writes the output to the [Microsoft.AspNet.Mvc.ViewContext.Writer]().

Return type:System.Threading.Tasks.Task
Returns:A task representing the result of executing the page.
Task ExecuteAsync()