Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CreateController Method

DefaultControllerFactory.CreateController Method (RequestContext, String)

 

Creates the specified controller by using the specified request context.

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

public virtual IController CreateController(
	RequestContext requestContext,
	string controllerName
)

Parameters

requestContext
Type: System.Web.Routing.RequestContext

The context of the HTTP request, which includes the HTTP context and route data.

controllerName
Type: System.String

The name of the controller.

Return Value

Type: System.Web.Mvc.IController

The controller.

Exception Condition
ArgumentNullException

The requestContext parameter is null.

ArgumentException

The controllerName parameter is null or empty.

Return to top
Show:
© 2015 Microsoft