You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AlexBar edited this page Apr 14, 2012
·
2 revisions
The MvcExtensions provedes a way to register custom model binders. All you need to do is to inherit from ConfigureModelBindersBase class:
public class ConfigureModelBinders : ConfigureModelBindersBase
{
public ConfigureModelBinders(TypeMappingRegistry<object, IModelBinder> registry) : base(registry) { }
protected override void Configure()
{
Registry.Register<ProductEditModel, ProductEditModelBinder>();
}
}
And then include that task into bootstrapper:
//Global.asax.cs
public class MvcApplication : MvcExtensions.WindsorMvcApplication
{
public MvcApplication()
{
Bootstrapper.BootstrapperTasks
// other tasks here
.Include<ConfigureModelBinders>();
}
}