views:

139

answers:

1

Hello all,

In ASP.NET MVC Beta I was able to get the form parameters of

<input id="addresses[40].City" name="addresses[40].City" type="text" value="City" />
<input id="addresses[40].Country" name="addresses[40].Country" type="text" value="Country" />

as Edit(List<Address> addresses) in controller action.

Nonetheless, in the new Release Candidate I cannot retrieve the values(null) as a parameter in action. I can see the values when I make a FormCollection parameter, but it will be a headache to parse all the Key/Value pairs into a object.

Any help would be appreciated.

+2  A: 

The scheme for list binding changed in the release candidate. Prior to the release candidate, you would have a hidden field which indicated what the index was (40, in your case). In the release candidate, you no longer need this hidden field, but your index must be numeric and must start with 0.

Craig Stuntz
Thanks, exactly what I was looking for. Shame this wasn't in the Release Notes!
Simon Steele
Agree on that, although this caused me a lot of headache, it solved the problem.