Thoughts from Dan Miser RSS 2.0
 Wednesday, January 28, 2009

There were a few changes between ASP.NET MVC Beta and RC1 regarding list binding. For background on list binding, look at Phil Haack's excellent article. Here are the changes that I saw, some good, and some bad:

  • You no longer need to specify the ".index" hidden field. This is good, as it's one less hidden field to take care of.
  • Binding occurs automatically for lists of complex types, but you must have contiguous numbering of the elements, starting with zero. This means that you can no longer specify the index with things like key information. I'm not wild about this change.
  • In the Beta release, binding would only occur for properties of IList. I've been using LightSpeed lately, and that means my property looks like this: EntityCollection<FooType> FooProperty. EntityCollection supports IList, but because it wasn't truly an IList in the class declaration, the default binding didn't work. In the Beta release, I got around this by adding a mirrored property of IList<FooType> and then copying the data over to FooProperty in my controller method.
  • Nested property references, e.g. Foo.Bar, now get the resulting input id renamed to Foo_Bar. This makes it easier to work with jQuery selectors on these elements.

All in all, I'm really liking the RC1 release. I'm looking forward to the release!

Wednesday, January 28, 2009 6:04:53 PM (Central Standard Time, UTC-06:00)  #    Comments [1] -
ASP.NET
Navigation
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Dan Miser
Sign In
Statistics
Total Posts: 339
This Year: 5
This Month: 0
This Week: 0
Comments: 618
All Content © 2010, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)