Firefox密码字段已预先填充

时间:2014-02-22 00:12:08

标签: asp.net-mvc firefox browser html-input

我有以下代码:

 <dl class="dl-table">
                         <dt style="width:170px">Current Password:</dt>
                            <dd>
                               @Html.Password("CurrentPassword", "")
                            </dd>
                           <dt style="width:170px">New Password:</dt>
                            <dd>
                              @Html.Password("NewPassword", "")
                            </dd>
                           <dt style="width:170px">Confirm New Password:</dt>
                            <dd>
                              @Html.Password("ConfirmNewPassword", "")
                            </dd>
                        </dl>

但是,出于某种原因,它显示如下:

enter image description here

为什么预先填充?

1 个答案:

答案 0 :(得分:1)

尝试设置autocomplete="off"

@Html.Password("ConfirmNewPassword", "", new { autocomplete = "off" } )