0
MVC 5에 익숙하지 않으며 암호 확인 필드에 동일한 암호를 입력하려고 할 때마다 항상 유효성 검사 메시지 [Compare]
이 발생합니다. 이것은 일반적인 문제입니까? 내 코드는보기MVC 5 암호 비교 항상 유효성 확인
<div class="form-group">
@Html.LabelFor(model => model.UserName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.UserName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.UserName, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.PasswordFor(m => m.Password, new { @class = "form-control required" })
@Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.ConfirmPassword, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control required" })
@Html.ValidationMessageFor(model => model.ConfirmPassword, "", new { @class = "text-danger" })
</div>
</div>
양식을 제출할 작업을 표시 할 수도 있습니까? – Usman
두 개의 CompareAttribute 클래스가 있습니다 - 어떤 클래스를 사용하고 있는지 알고 계십니까? –
@TiesonT. 그들은 둘 다 똑같이 일하지 않습니까? – Usman