I see examples around the world of people who customize their custom model bindings as follows:
// global.asax protected void Application_Start() { ModelBinders.Binders.Add(typeof(YourModel), new YourBinder()); }
But when I try to do this, it does not compile ( .Binders not found). What gives?
.Binders
Turns out it was just a name conflict, because I put my own connecting device in the / namespace folder called "ModelBinders". You can fix this in two ways:
CustomModelBinders
Use the full reference to ModelBinders as follows:
ModelBinders
System.Web.Mvc.ModelBinders.Binders.Add( /* ... */ );