开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜