ViewContext ViewContext ViewContext Class

Definition

Context for view execution.

public class ViewContext : Microsoft.AspNetCore.Mvc.ActionContext
type ViewContext = class
    inherit ActionContext
Public Class ViewContext
Inherits ActionContext
Inheritance

Constructors

ViewContext() ViewContext() ViewContext()

Creates an empty ViewContext.

ViewContext(ActionContext, IView, ViewDataDictionary, ITempDataDictionary, TextWriter, HtmlHelperOptions) ViewContext(ActionContext, IView, ViewDataDictionary, ITempDataDictionary, TextWriter, HtmlHelperOptions) ViewContext(ActionContext, IView, ViewDataDictionary, ITempDataDictionary, TextWriter, HtmlHelperOptions)

Initializes a new instance of ViewContext.

ViewContext(ViewContext, IView, ViewDataDictionary, TextWriter) ViewContext(ViewContext, IView, ViewDataDictionary, TextWriter) ViewContext(ViewContext, IView, ViewDataDictionary, TextWriter)

Initializes a new instance of ViewContext.

Properties

ActionDescriptor ActionDescriptor ActionDescriptor

Gets or sets the ActionDescriptor for the selected action.

(Inherited from ActionContext)
ClientValidationEnabled ClientValidationEnabled ClientValidationEnabled

Gets or sets a value that indicates whether client-side validation is enabled.

ExecutingFilePath ExecutingFilePath ExecutingFilePath

Gets or sets the path of the view file currently being rendered.

FormContext FormContext FormContext

Gets or sets the FormContext for the form element being rendered. A default context is returned if no form is currently being rendered.

Html5DateRenderingMode Html5DateRenderingMode Html5DateRenderingMode

Set this property to CurrentCulture to have templated helpers such as Editor(String, String, String, Object) and EditorFor<TResult>(Expression<Func<TModel,TResult>>, String, String, Object) render date and time values using the current culture. By default, these helpers render dates and times as RFC 3339 compliant strings.

HttpContext HttpContext HttpContext

Gets or sets the HttpContext for the current request.

(Inherited from ActionContext)
ModelState ModelState ModelState

Gets the ModelStateDictionary.

(Inherited from ActionContext)
RouteData RouteData RouteData

Gets or sets the RouteData for the current request.

(Inherited from ActionContext)
TempData TempData TempData

Gets or sets the ITempDataDictionary instance.

ValidationMessageElement ValidationMessageElement ValidationMessageElement

Element name used to wrap a top-level message generated by ValidationMessage(String, String, Object, String) and other overloads.

ValidationSummaryMessageElement ValidationSummaryMessageElement ValidationSummaryMessageElement

Element name used to wrap a top-level message generated by ValidationSummary(Boolean, String, Object, String) and other overloads.

View View View

Gets or sets the IView currently being rendered, if any.

ViewBag ViewBag ViewBag

Gets the dynamic view bag.

ViewData ViewData ViewData

Gets or sets the ViewDataDictionary.

Writer Writer Writer

Gets or sets the TextWriter used to write the output.

Methods

GetFormContextForClientValidation() GetFormContextForClientValidation() GetFormContextForClientValidation()

Applies to