它顯示了一些不需要的autocomplete
建議。
我覺得那些建議來自UserName
文本字段。
但我沒有找到任何理由這些建議。
不需要的自動填充建議ASP.NET MVC-5 Razor
型號代碼:
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
[Required(ErrorMessage = "Birth Date is Reqired")]
[DataType(DataType.DateTime)]
[Display(Name = "Birth Date")]
public DateTime BirthDate { get; set; }
剃刀檢視:
<div class="container jumbotron" style="background-color:whitesmoke">
<div class="row">
<div class="col-md-4" style="margin-left: 400px; margin-top:30px">
<section id="loginForm">
@Html.ValidationSummary(true)
@using (Html.BeginForm("Registration", "SignUp", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="form-group">
@Html.LabelFor(m => m.FirstName)
@Html.TextBoxFor(m => m.FirstName, new {@class = "form-control"})
@Html.ValidationMessageFor(m => m.FirstName)
</div>
<div class="form-group">
@Html.LabelFor(m => m.LastName)
@Html.TextBoxFor(m => m.LastName, new {@class = "form-control"})
@Html.ValidationMessageFor(m => m.LastName)
</div>
<div class="form-group">
@Html.LabelFor(m => m.UserName)
@Html.TextBoxFor(m => m.UserName, new {@class = "form-control"})
@Html.ValidationMessageFor(m => m.UserName)
</div>
<div class="form-group">
@Html.LabelFor(m => m.EmailAddress)
@Html.TextBoxFor(m => m.EmailAddress, new {@class = "form-control"})
@Html.ValidationMessageFor(m => m.EmailAddress)
</div>
<div class="form-group">
@Html.LabelFor(m => m.BirthDate)
<input class="form-control" value="yyyy-MM-dd" name="BirthDate" type="text" id="BirthDate" autocomplete="off">
@Html.ValidationMessageFor(m => m.BirthDate)
</div>
<div class="form-group">
@Html.LabelFor(m => m.PassWord)
@Html.PasswordFor(m => m.PassWord, new {@class = "form-control"})
@Html.ValidationMessageFor(m => m.PassWord)
</div>
<div class="form-group">
@Html.LabelFor(m => m.VerifyPassWord)
@Html.PasswordFor(m => m.VerifyPassWord, new {@class = "form-control"})
@Html.ValidationMessageFor(m => m.VerifyPassWord)
</div>
<div class="form-group">
@Html.LabelFor(m => m.VersityId)
@Html.TextBoxFor(m => m.VersityId, new {@class = "form-control"})
@Html.ValidationMessageFor(m => m.VersityId)
</div>
<div class="form-group">
@Html.LabelFor(m => m.PhoneNumber)
@Html.TextBoxFor(m => m.PhoneNumber, new {@class = "form-control"})
@Html.ValidationMessageFor(m => m.PhoneNumber)
</div>
<div class="form-group">
@Html.LabelFor(m => m.Address)
@Html.TextAreaFor(m => m.Address, new {@class = "form-control"})
@Html.ValidationMessageFor(m => m.Address)
</div>
<div class="form-group">
<input id="ImageUpload" type="file" name="ImageUpload" />
</div>
<button type="submit" class="btn btn-primary">Save</button>
}
<p>
@Html.ActionLink("Already Have an Account", "LogIn")
</p>
</section>
</div>
</div>
問題視圖(圖像):
Problem indicate by red circle
我不想要這種建議。
請幫我解決這個問題。
非常感謝提前
https://stackoverflow.com/questions/18531437/stop-google-chrome-auto-fill-the-input – adiga