我有这个:
model.PasswordField = null;
return View("MainLogin", model);
我的模型包含LoginField
和PasswordField
。我LoginField
保持原样,但我删除PasswordField
。现在,当MainLogin
视图呈现时,字段密码具有我之前请求的值!为什么?
更新:添加了我的视图代码:
<div class="editor-field">
@Html.TextBoxFor(model => model.PasswordField, new { placeholder = "Password" })
@Html.ValidationMessageFor(model => model.PasswordField)
</div>