Last post Sep 29, 2008 02:38 AM by samiq
Aug 29, 2008 04:09 PM|jkiley|LINK
I seem to have misplaced the handy BindingHelperExtensions class upon updating from Preview 4 to 5 - has it been removed? I didn't notice any mention of it in the readme but I don't see it in System.Web.Mvc any longer either. I have been using BindingHelperExtensions.UpdateFrom
to update model entities whose properties map exactly to the fields on a form. I assume its removal means that I should consider using a different method for updating my model from a submit-type action. It seems the new ModelBinder might be used for this
purpose but I am not entirely sure about its intended use. Any pointers?
ASP.NET mvc BindingHelperExtensions
Aug 29, 2008 08:28 PM|ironside14|LINK
I've got the same problem. Would appreciate if someone on the project could shed some light on whatever "big new thing" replaces BindingHelperExtensions?
Aug 29, 2008 08:36 PM|ceilidhboy|LINK
Aug 29, 2008 08:52 PM|ironside14|LINK
I think this functionality might be native on the controller now, via UpdateModel().
I can't try it yet because it appears RenderUserControl() is also gone! (which my app also uses) :\
Aug 29, 2008 09:12 PM|ceilidhboy|LINK
Yes, UpdateModel seems to be the way to go...
Try using RenderPartial instead of RenderUserControl.
Aug 29, 2008 10:22 PM|ironside14|LINK
OK this does work.
Aug 29, 2008 10:55 PM|jkiley|LINK
Excellent, works for me too; UpdateModel does provide the same function as the pre-preview 5 BindingHelperExtensions.UpdateFrom.
Aug 30, 2008 12:37 AM|jwheeler79|LINK
You can also use ComplexModelBinder with the ModelBinder attribute in the Microsoft.Web.Mvc futures package. You'll need to supply the full path in any form fields
So instead of "Propery", you need "Model.Property"
Sep 29, 2008 02:38 AM|samiq|LINK
Works great! Thanks a lot!!