密码和确认密码不匹配 即使你在两个字段中都写了相同的密码,也会给我错误,并说密码不匹配。
这就是帐户的样子:
[Required]
[StringLength(50, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
这是注册页面:
<div class="form-group">
@Html.LabelFor(model => model.Password, new {@class = "control-label col-md-2"})
<div class="col-md-10">
@Html.EditorFor(model => model.Password, new {htmlAttributes = new {@class = "form-control"}})
@Html.ValidationMessageFor(model => model.Password, "", new {@class = "text-danger"})
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.ConfirmPassword, new {@class = "control-label col-md-2"})
<div class="col-md-10">
@Html.EditorFor(model => model.ConfirmPassword, new {htmlAttributes = new {@class = "form-control"}})
@Html.ValidationMessageFor(model => model.ConfirmPassword, "", new {@class = "text-danger"})
</div>
</div>
我在谷歌和这个论坛上搜索过,但我找不到任何有用的东西。
有人可以帮助我吗?
这是数据库: http://i.stack.imgur.com/D86QV.png
您可以尝试注册:http://ursaciucadrian.somee.com/Home/Register?Length=4
答案 0 :(得分:0)
来自2013的旧错误,尝试更新所有项目的依赖项:
transform: translateZ
答案 1 :(得分:-1)
经过大量的教程和搜索,我意识到问题来自脚手架。
我不得不改变
JsonElement jelement = new JsonParser().parse(getJSON(url, timeout));
JsonObject jobject = jelement.getAsJsonObject();
jobject = jobject.getAsJsonObject("data");
在此:
public ActionResult Register([Bind(Include = "AccountId,FullName,Username,Password,Email")] Account account)
{
if (ModelState.IsValid)
{
db.Accounts.Add(account);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(account);
}