CSLA 3.8 and MVC 2 Beta (ModelBinder)

CSLA 3.8 and MVC 2 Beta (ModelBinder)

Old forum URL: forums.lhotka.net/forums/t/8066.aspx


xAvailx posted on Monday, November 30, 2009

In case you are trying to use MVC 2 Beta with CSLA 3.8, there is a breaking in MVC 2 Beta with ValueProvider.

Here is what you need to do to get csla model binding working.

In CSLA.Web.Mvc, reference MVC 2 Beta assembly, if you try to compile, you should get an error.

In CslaModelBinder class..

Change:

//bindingContext.ModelState.SetModelValue(item.Property, bindingContext.ValueProvider[item.Property]);

to

bindingContext.ModelState.SetModelValue(item.Property, bindingContext.ValueProvider.GetValue(controllerContext, item.Property));

HTH someone :)

Copyright (c) Marimer LLC