ControllerContext Class (System.Web.Mvc)

Switch View :
ScriptFree
.NET Framework Class Library
ControllerContext Class

Encapsulates information about an HTTP request that matches specified RouteBase and ControllerBase instances.

Inheritance Hierarchy

System.Object
  System.Web.Mvc.ControllerContext
    System.Web.Mvc.ActionExecutedContext
    System.Web.Mvc.ActionExecutingContext
    System.Web.Mvc.AuthorizationContext
    System.Web.Mvc.ExceptionContext
    System.Web.Mvc.ResultExecutedContext
    System.Web.Mvc.ResultExecutingContext
    System.Web.Mvc.ViewContext

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

Visual Basic (Declaration)
Public Class ControllerContext
Visual Basic (Usage)
Dim instance As ControllerContext
C#
public class ControllerContext
Visual C++
public ref class ControllerContext
JScript
public class ControllerContext

The ControllerContext type exposes the following members.

Constructors

  Name Description
Public method ControllerContext() Initializes a new instance of the ControllerContext class.
Protected method ControllerContext(ControllerContext) Initializes a new instance of the ControllerContext class by using the specified controller context.
Public method ControllerContext(RequestContext, ControllerBase) Initializes a new instance of the ControllerContext class by using the specified request context and controller.
Public method ControllerContext(HttpContextBase, RouteData, ControllerBase) Initializes a new instance of the ControllerContext class by using the specified HTTP context, URL route data, and controller.
Top
Properties

  Name Description
Public property Controller Gets or sets the controller.
Public property HttpContext Gets or sets the HTTP context.
Public property IsChildAction Gets a value that indicates whether the associated action method is a child action.
Public property ParentActionViewContext Gets an object that contains the view context information for the parent action method.
Public property RequestContext Gets or sets the request context.
Public property RouteData Gets or sets the URL route data.
Top
Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)
Top
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

Reference