ViewContext Class

 

Encapsulates information that is related to rendering a view.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Inheritance Hierarchy

System.Object
  System.Web.Mvc.ControllerContext
    System.Web.Mvc.ViewContext

Syntax

public class ViewContext : ControllerContext
public ref class ViewContext : ControllerContext
type ViewContext = 
    class
        inherit ControllerContext
    end
Public Class ViewContext
    Inherits ControllerContext

Constructors

Name Description
System_CAPS_pubmethod ViewContext()

Initializes a new instance of the ViewContext class.

System_CAPS_pubmethod ViewContext(ControllerContext, IView, ViewDataDictionary, TempDataDictionary, TextWriter)

Initializes a new instance of the ViewContext class by using the specified controller context, view, view data dictionary, temporary data dictionary, and text writer.

Properties

Name Description
System_CAPS_pubproperty ClientValidationEnabled

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

System_CAPS_pubproperty Controller

Gets or sets the controller.(Inherited from ControllerContext.)

System_CAPS_pubproperty DisplayMode

Gets the display mode.(Inherited from ControllerContext.)

System_CAPS_pubproperty FormContext

Gets or sets an object that encapsulates information that is required in order to validate and process the input data from an HTML form.

System_CAPS_pubproperty HttpContext

Gets or sets the HTTP context.(Inherited from ControllerContext.)

System_CAPS_pubproperty IsChildAction

Gets a value that indicates whether the associated action method is a child action.(Inherited from ControllerContext.)

System_CAPS_pubproperty ParentActionViewContext

Gets an object that contains the view context information for the parent action method.(Inherited from ControllerContext.)

System_CAPS_pubproperty RequestContext

Gets or sets the request context.(Inherited from ControllerContext.)

System_CAPS_pubproperty RouteData

Gets or sets the URL route data.(Inherited from ControllerContext.)

System_CAPS_pubproperty TempData

Gets data that is associated with this request and that is available for only one request.

System_CAPS_pubproperty UnobtrusiveJavaScriptEnabled

Gets or sets a value that indicates whether unobtrusive JavaScript is enabled.

System_CAPS_pubproperty ValidationMessageElement

Element name used to wrap a top-level message generated by ValidationMessage and other overloads.

System_CAPS_pubproperty ValidationSummaryMessageElement

Element name used to wrap a top-level message generated by ValidationSummary and other overloads.

System_CAPS_pubproperty View

Gets an object that implements the IView interface to render in the browser.

System_CAPS_pubproperty ViewBag

Gets the dynamic view data dictionary.

System_CAPS_pubproperty ViewData

Gets the view data that is passed to the view.

System_CAPS_pubproperty Writer

Gets or sets the text writer object that is used to write HTML output.

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod OutputClientValidation()

Writes the client validation information to the HTTP response.

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

System.Web.Mvc Namespace

Return to top