我有 MVC5 应用程序,在创建 View 中我有用户和密码字段。
我在用户和密码字段中输入值,当我进入编辑模式时,我只在文本框中看到用户值
密码字段为空,为什么?
当我调试代码时,我看到在编辑结束时( return View(UserPass); )我得到了带有值的对象,并且它调用了 View (razor),并且我没有在通过文本框...
知道为什么用户存在而密码不存在吗? 我只是希望它是在编辑模式下带有星号的字段...
在编辑和创建 View 中我使用:
<div class="form-group">
@Html.LabelFor(model => model.Password, new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.PasswordFor(model => model.Password)
@Html.ValidationMessageFor(model => model.Password)
</div>
</div>
最佳答案
关于asp.net - 字段密码返回空以在编辑模式下查看,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23543149/