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)

'Declaration
Public Overridable Function CreateController ( _
	requestContext As RequestContext, _
	controllerName As String _
) As IController
'Usage
Dim instance As DefaultControllerFactory 
Dim requestContext As RequestContext 
Dim controllerName As String 
Dim returnValue As IController 

returnValue = instance.CreateController(requestContext, _
	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.

Implements

IControllerFactory.CreateController(RequestContext, String)

ExceptionCondition
ArgumentNullException

The requestContext parameter is Nothing.

ArgumentException

The controllerName parameter is Nothing or empty.

Show: