GetBinder Method
Collapse the table of content
Expand the table of content

ModelBinderProviderCollection.GetBinder Method (ModelBindingExecutionContext, ModelBindingContext)

.NET Framework (current version)
 

Returns the appropriate model binder for the specified execution context and binding context.

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

member GetBinder : 
        modelBindingExecutionContext:ModelBindingExecutionContext *
        bindingContext:ModelBindingContext -> IModelBinder

Parameters

modelBindingExecutionContext
Type: System.Web.ModelBinding.ModelBindingExecutionContext

The execution context.

bindingContext
Type: System.Web.ModelBinding.ModelBindingContext

The binding context.

Return Value

Type: System.Web.ModelBinding.IModelBinder

The model binder.

Exception Condition
ArgumentNullException

The modelBindingExecutionContext or the bindingContext is null.

InvalidOperationException

No model binder or model binder provider exists for the specified model type.

.NET Framework
Available since 4.5
Return to top
Show:
© 2016 Microsoft