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)

Syntax

public virtual IController CreateController(
    RequestContext requestContext,
    string controllerName
)
public:
virtual IController^ CreateController(
    RequestContext^ requestContext,
    String^ controllerName
)
abstract CreateController : 
        requestContext:RequestContext *
        controllerName:string -> IController
override CreateController : 
        requestContext:RequestContext *
        controllerName:string -> IController
Public Overridable Function CreateController (
    requestContext As RequestContext,
    controllerName As String
) As IController

Parameters

Return Value

Type: System.Web.Mvc.IController

The controller.

Implements

IControllerFactory.CreateController(RequestContext, String)

Exceptions

Exception Condition
ArgumentNullException

The requestContext parameter is null.

ArgumentException

The controllerName parameter is null or empty.

See Also

DefaultControllerFactory Class
System.Web.Mvc Namespace

Return to top