小编As *_* Lk的帖子

我的模型的属性无法找到

当我尝试在我的项目中重置密码时,它会抛出异常. 这是我的模特

public class ResetPasswordConfirmModel
{
    public string Toke { get; set; }

    [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
    [DataType(DataType.Password)]
    [Display(Name = "New password")]
    public string NewPassword { get; set; }

    [DataType(DataType.Password)]
    [Display(Name = "confirm new password")]
    [System.Web.Mvc.Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
    public string ConfirmPassword { get; set; }
Run Code Online (Sandbox Code Playgroud)

账户管理员

 [AllowAnonymous]
    [HttpPost]
    public ActionResult ResetPasswordConfirmation(ResetPasswordConfirmModel model)
    {
       if(WebSecurity.ResetPassword(model.Toke,model.NewPassword))
       {
           return RedirectToAction("PasswordResetSuccess");
       }
        return RedirectToAction("PasswordResetFailure"); …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc-4

1
推荐指数
1
解决办法
2195
查看次数

标签 统计

asp.net-mvc-4 ×1