这是一个ASP.NET MVC网站,firefox 8.0是该版本。
在注册页面上,它是预先填写的字段,如电子邮件和密码。不仅如此,它还预填充电子邮件,其中包含用户名和密码以及密码。更令人费解的是,为什么它认为用户名是电子邮件?!
Internet Explorer没有这样做。我不认为firefox也会提前做。与此同时,我也记得最近升级firefox。
如果我在Firefox中取消选中“记住网站密码”,这种行为当然就会消失。
我知道我可以通过autocomplete =“off”摆脱这个功能,但令我困惑的是为什么它用用户名预先填写电子邮件字段?!
这是因为它正在查看密码字段正上方的字段,一旦我在密码字段正上方创建了用户名字段,就可以了。有趣。
<%Html.EnableClientValidation(); %>
<% using (Html.BeginForm("Register", "Account", FormMethod.Post))
{ %>
<%= Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")%>
<div>
<fieldset>
<legend>Account Information</legend>
<div class="editor-label">
<%= Html.LabelFor(m => m.Email)%>
</div>
<div class="editor-field">
<%= Html.TextBoxFor(m => m.Email)%>
<%= Html.ValidationMessageFor(m => m.Email)%>
</div>
<div class="editor-label">
<%= Html.LabelFor(m => m.UserName)%>
</div>
<div class="editor-field">
<%= Html.TextBoxFor(m => m.UserName)%>
<%= Html.ValidationMessageFor(m => m.UserName)%>
</div>
<div class="editor-label">
<%= Html.LabelFor(m => m.Password)%>
</div>
<div class="editor-field">
<%= Html.PasswordFor(m => m.Password)%>
<%= Html.ValidationMessageFor(m => m.Password)%>
</div>
<div class="editor-label">
<%= Html.LabelFor(m => m.ConfirmPassword)%>
</div>
<div class="editor-field">
<%= Html.PasswordFor(m => m.ConfirmPassword)%>
<%= Html.ValidationMessageFor(m => m.ConfirmPassword)%>
</div>
<div class="editor-label">
<%= Html.LabelFor(m => m.DateOfBirth)%>
</div>
<div class="editor-field">
<%= Html.EditorFor(m => m.DateOfBirth)%>
<%= Html.ValidationMessageFor(m => m.DateOfBirth)%>
</div>
<div class="editor-label">
<%= Html.LabelFor(m => m.Gender)%>
</div>
<div class="editor-field">
<%= Html.DropDownListFor(m => m.Gender, Enumerable.Range(1, 2).Select(i => new SelectListItem
{
Value = i.ToString(),
Text = i == 1 ? "Female" : "Male",
Selected = (i == 1)
}), "-- Gender --")%>
<%= Html.ValidationMessageFor(m => m.Gender)%>
</div>
<p>
<input type="submit" value="Register" />
</p>
</fieldset>
</div>
<% } %>