jquery – How ASP.NET MVC knows which property of JavaScript control to use when binding? – Education Career Blog

I know it’s possible to change view representation of any .NET type by changing strongly-typed partial view. The most popular example is when simple ToString() call on DateTime instance is changed to a great-looking JQuery UI calendar.
My question is – how does ASP.NET MVC know what property of JavaScript control to use when binding to a property of a view model? Is there a convention for that (or at least Phil Haack post about it)? If it is, both ASP.NET MVC and JS library requires some kind of rule, or only one side?

,

The model binder knows nothing about javascript. When binding action parameters it looks at the request sent to the server and binds properties using conventions. Scot Hanselman blogged about some advanced binding conventions used by the binder.

Leave a Comment