IModelBinder and property key for successful binding at the ModelState + partial form validation

יום חמישי, אוקטובר 28, 2010

I’m talking about asp.net MVC2 The point: if you are implementing an IModelBinder for a type, you should add a call to bindingContext.ModelState.SetModelValue(bindingContext.ModelName, valueFromRequest); this is done to make sure that at your controller action you can access ModelState and nameOfThisProperty  will be present as a key at ModelState also for successful binding.   And for the details: (  Partial form validation including custom modelBinding  for trimming strings) why am I using ModelState...