自动完成功能无效。我试过autocomplete="off"
,autocomplete="nope"
和autocomplete="false"
。输入文本框中仍显示密码和用户名
@Html.EditorFor(model => model.CustomerPasswordVM.OldPassword, new { htmlAttributes = new { @class = "form-control" } })
来自:https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
"off"
The browser is not permitted to automatically enter or select a value for this field.
It is possible that the document or application provides its own autocomplete feature,
or that security concerns require that the field's value not be
automatically entered.
Note: In most modern browsers, setting autocomplete to "off" will not
prevent a password manager from asking the user if they would like to save
username and password information, or from automatically filling in those
values in a site's login form. See the autocomplete attribute and login
fields.
这可能是你的问题吗?
我也面临同样的问题,下面的代码帮助了我。
@Html.EditorFor(model => model.CustomerPasswordVM.OldPassword, new { htmlAttributes = new { @class = "form-control", @readonly= "readonly", @onfocus = "this.removeAttribute('readonly');" } })