Partager via


DefaultControllerFactory.CreateController Method

Creates the specified controller by using the specified request context.

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

Syntax

'Declaration
Public Overridable Function CreateController ( _
    requestContext As RequestContext, _
    controllerName As String _
) As IController
public virtual IController CreateController(
    RequestContext requestContext,
    string controllerName
)
public:
virtual IController^ CreateController(
    RequestContext^ requestContext, 
    String^ controllerName
)

Parameters

Return Value

Type: System.Web.Mvc.IController
A reference to the controller.

Implements

IControllerFactory.CreateController(RequestContext, String)

Exceptions

Exception Condition
ArgumentNullException

The requestContext parameter is null reference (Nothing in Visual Basic).

ArgumentException

The controllerName parameter is null reference (Nothing in Visual Basic) or empty.

See Also

Reference

DefaultControllerFactory Class

System.Web.Mvc Namespace