I have a Dictionary<int, PostCode>
called PostcodeData
in an MVC4 VM. I'm trying to bind to the Serialized property on the PostCode
DTO. In Razor, I've tried:
@Html.HiddenFor(m => m.PostcodeData [code.Id].Serialized)
And
<input type="hidden" name="PostcodeData[@code.Id].Serialized" />
But the dictionary is empty when the page posts back. According to ASP.NET MVC Binding to a dictionary I should be able to bind to it though. Am I missing something?