Changing the default model binding in asp.net MVC

Is there any way to set DefaultBinder default on my own?

+35
asp.net-mvc
Apr 12 '09 at 10:53
source share
2 answers
ModelBinders.Binders.DefaultBinder = new MyOwnModelBinder(); 
+58
Apr 12 '09 at 11:01
source share

In Global.asax.cs:

 public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { //... ModelBinders.Binders.DefaultBinder = new MyModelBinder(); } } 
0
Jul 05 '19 at 21:15
source share



All Articles