Is there any way I can set the default ModelBinder to one of my own?
Change the default model binder in asp.net MVC
Asked Answered
ModelBinders.Binders.DefaultBinder = new MyOwnModelBinder();
i believe so... in MvcApplication.Application_Start() –
Sabellian
In the Global.asax.cs:
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
//...
ModelBinders.Binders.DefaultBinder = new MyModelBinder();
}
}
© 2022 - 2024 — McMap. All rights reserved.
Global.asax.cs
? Or somewhere else? – Unsuccess