【发布时间】:2011-02-04 20:11:55
【问题描述】:
我对 asp.net mvc 2 和 html.textboxfor 助手有疑问。 我在表单中使用以下代码:
<%= Html.TextBoxFor(model => model.Zip, new { @class = "txt", id = "zip", tabindex = 1 })%>
当用户发送表单时,我验证邮政编码,当邮政编码无效时,我们设置更正的邮政编码。 我的模型有更正的 zip,从 asp 生成的 html 代码包含旧的 zip 值。
示例: 用户写 zip:12345 我的验证课,将 zip 更正为:12346 我的模型包含新的 zip:123456,在 gui 上我只看到 12345
有什么问题?
【问题讨论】:
标签: asp.net asp.net-mvc caching refresh html.textbox