DefaultModelBinder class in System.Web.Mvc

While working with validation for an  MVC application I came across option for using  DefaultModelBinder class.

public class DefaultModelBinder : IModelBinder

maps following types in response to a request.
primitive types, model classes and collections

What it does is, it takes the required object from the model, binds its properties to the corresponding HTML fields of the form (View).

If the class it is binding implements IDataErrorInfo interface, which binds the developer to implement following properties

Error:  string Error { get; }

Item :  string this[string columnName] { get; }

If a class implements the interface, it ftches the value for the fields, by invoking IDataErrorInfo.this indexer.

What you can do interesting is you can perform your validation / checks and over an object in focus and  if in case it fails to correspond with the requirements, like a customer has provided wrong value for the name of something, It will return the error value , custom provided  at the time of implementation of the interface. Have a look.

Here are details for DefaultModelBinder