ControllerContext Class

 

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

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

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.Filters.AuthenticationChallengeContext
    System.Web.Mvc.Filters.AuthenticationContext
    System.Web.Mvc.ResultExecutedContext
    System.Web.Mvc.ResultExecutingContext
    System.Web.Mvc.ViewContext

Syntax

public class ControllerContext
public ref class ControllerContext 
type ControllerContext = class end
Public Class ControllerContext

Constructors

Name Description
System_CAPS_pubmethod ControllerContext()

Initializes a new instance of the ControllerContext class.

System_CAPS_protmethod ControllerContext(ControllerContext)

Initializes a new instance of the ControllerContext class by using the specified controller context.

System_CAPS_pubmethod ControllerContext(HttpContextBase, RouteData, ControllerBase)

Initializes a new instance of the ControllerContext class by using the specified HTTP context, URL route data, and controller.

System_CAPS_pubmethod ControllerContext(RequestContext, ControllerBase)

Initializes a new instance of the ControllerContext class by using the specified request context and controller.

Properties

Name Description
System_CAPS_pubproperty Controller

Gets or sets the controller.

System_CAPS_pubproperty DisplayMode

Gets the display mode.

System_CAPS_pubproperty HttpContext

Gets or sets the HTTP context.

System_CAPS_pubproperty IsChildAction

Gets a value that indicates whether the associated action method is a child action.

System_CAPS_pubproperty ParentActionViewContext

Gets an object that contains the view context information for the parent action method.

System_CAPS_pubproperty RequestContext

Gets or sets the request context.

System_CAPS_pubproperty RouteData

Gets or sets the URL route data.

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 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