MVC Post Binding, multiple instances of target type
I'm running into a very strange issue. Essentially I'm seeing a text box's value not be bound properly once I get to the controller's POST handler.
Pretty simple really, I have an object with ZipPostalCode and am adding that to my view using TextBoxFor:
<%= Html.TextBoxFor(model => model.ZipPostalCode) %>
Adding breakpoints to the getter and setter for the property I开发者_JS百科 can see that I come through the property's Setter with the correct value and store it but the next time through I have a new instance of my model and as such don't have that value anymore.
Really baffling, any input is greatly appreciated.
Edit: It's worth mentioning that the object I'm passing to the view is an Entity Framework generated object
精彩评论