Partager via


DefaultModelBinder.CreateModel Method

Creates the specified model type by using the specified controller context and binding context.

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

Syntax

'Declaration
Protected Overridable Function CreateModel ( _
    controllerContext As ControllerContext, _
    bindingContext As ModelBindingContext, _
    modelType As Type _
) As Object
protected virtual Object CreateModel(
    ControllerContext controllerContext,
    ModelBindingContext bindingContext,
    Type modelType
)
protected:
virtual Object^ CreateModel(
    ControllerContext^ controllerContext, 
    ModelBindingContext^ bindingContext, 
    Type^ modelType
)

Parameters

  • controllerContext
    Type: System.Web.Mvc.ControllerContext
    The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data.
  • bindingContext
    Type: System.Web.Mvc.ModelBindingContext
    The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider.
  • modelType
    Type: System.Type
    The type of the model object to return.

Return Value

Type: System.Object
A data object of the specified type.

See Also

Reference

DefaultModelBinder Class

System.Web.Mvc Namespace