Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Maps a browser request to a data object. This class provides a concrete implementation of a model binder.
Inheritance Hierarchy
System.Object
System.Web.Mvc.DefaultModelBinder
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
Syntax
'Declaration
Public Class DefaultModelBinder _
Implements IModelBinder
public class DefaultModelBinder : IModelBinder
public ref class DefaultModelBinder : IModelBinder
The DefaultModelBinder type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
![]() |
DefaultModelBinder | Initializes a new instance of the DefaultModelBinder class. |
Top
Properties
| Name | Description | |
|---|---|---|
![]() |
Binders | Gets or sets the model binders for the application. |
![]() ![]() |
ResourceClassKey | Gets or sets the name of the resource file (class key) that contains localized string values. |
Top
Methods
| Name | Description | |
|---|---|---|
![]() |
BindModel | Binds the model by using the specified controller context and binding context. |
![]() |
BindProperty | Binds the specified property by using the specified controller context and binding context and the specified property descriptor. |
![]() |
CreateModel | Creates the specified model type by using the specified controller context and binding context. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
CreateSubPropertyName | Creates the name of the subproperty by using the specified prefix and property name. |
![]() |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() |
GetFilteredModelProperties | Returns a set of properties that match the property filter restrictions that are established by the specified binding context. |
![]() |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() |
GetModelProperties | Returns the properties of the model by using the specified controller context and binding context. |
![]() |
GetPropertyValue | Returns the value of a property using the specified controller context, binding context, property descriptor, and property binder. |
![]() |
GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() |
GetTypeDescriptor | Returns the descriptor object for a type that is specified by its controller context and binding context. |
![]() ![]() |
IsModelValid | Determines whether a data model is valid for the specified binding context. |
![]() |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() |
OnModelUpdated | Called when the model is updated. |
![]() |
OnModelUpdating | Called when the model is updating. |
![]() |
OnPropertyValidated | Called when the specified property is validated. |
![]() |
OnPropertyValidating | Called when the specified property is validating. |
![]() |
SetProperty | Sets the specified property by using the specified controller context, binding context, and property value. |
![]() |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
The DefaultModelBinder class maps the following types of objects to a browser request:
Primitive types, such as String , Double, Decimal , or DateTime objects.
Model classes, such as Person, Address, or Product.
Collections, such as ICollection<T>, IList<T>, or IDictionary<TKey, TValue>.
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.
.jpeg)
.jpeg)
.jpeg)
.gif)
.jpeg)