DefaultModelBinder Class

 

Maps a browser request to a data object. This class provides a concrete implementation of a model binder.

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

Inheritance Hierarchy

System.Object
  System.Web.Mvc.DefaultModelBinder

Syntax

public class DefaultModelBinder : IModelBinder
public ref class DefaultModelBinder : IModelBinder
type DefaultModelBinder = 
    class
        interface IModelBinder
    end
Public Class DefaultModelBinder
    Implements IModelBinder

Constructors

Name Description
System_CAPS_pubmethod DefaultModelBinder()

Initializes a new instance of the DefaultModelBinder class.

Properties

Name Description
System_CAPS_protproperty Binders

Gets or sets the model binders for the application.

System_CAPS_pubpropertySystem_CAPS_static ResourceClassKey

Gets or sets the name of the resource file (class key) that contains localized string values.

Methods

Name Description
System_CAPS_pubmethod BindModel(ControllerContext, ModelBindingContext)

Binds the model by using the specified controller context and binding context.

System_CAPS_protmethod BindProperty(ControllerContext, ModelBindingContext, PropertyDescriptor)

Binds the specified property by using the specified controller context and binding context and the specified property descriptor.

System_CAPS_protmethod CreateModel(ControllerContext, ModelBindingContext, Type)

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

System_CAPS_protmethodSystem_CAPS_static CreateSubIndexName(String, Int32)

Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is an integer.

System_CAPS_protmethodSystem_CAPS_static CreateSubIndexName(String, String)

Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is a string.

System_CAPS_protmethodSystem_CAPS_static CreateSubPropertyName(String, String)

Creates the name of the subproperty by using the specified prefix and property name.

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_protmethod GetFilteredModelProperties(ControllerContext, ModelBindingContext)

Returns a set of properties that match the property filter restrictions that are established by the specified binding context.

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_protmethod GetModelProperties(ControllerContext, ModelBindingContext)

Returns the properties of the model by using the specified controller context and binding context.

System_CAPS_protmethod GetPropertyValue(ControllerContext, ModelBindingContext, PropertyDescriptor, IModelBinder)

Returns the value of a property using the specified controller context, binding context, property descriptor, and property binder.

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod GetTypeDescriptor(ControllerContext, ModelBindingContext)

Returns the descriptor object for a type that is specified by its controller context and binding context.

System_CAPS_protmethodSystem_CAPS_static IsModelValid(ModelBindingContext)

Determines whether a data model is valid for the specified binding context.

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethod OnModelUpdated(ControllerContext, ModelBindingContext)

Called when the model is updated.

System_CAPS_protmethod OnModelUpdating(ControllerContext, ModelBindingContext)

Called when the model is updating.

System_CAPS_protmethod OnPropertyValidated(ControllerContext, ModelBindingContext, PropertyDescriptor, Object)

Called when the specified property is validated.

System_CAPS_protmethod OnPropertyValidating(ControllerContext, ModelBindingContext, PropertyDescriptor, Object)

Called when the specified property is validating.

System_CAPS_protmethod SetProperty(ControllerContext, ModelBindingContext, PropertyDescriptor, Object)

Sets the specified property by using the specified controller context, binding context, and property value.

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Remarks

The DefaultModelBinder class maps the following types of objects to a browser request:

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

System.Web.Mvc Namespace

Return to top