Beispiel #1
0
        public ActionResult ResetPassword(ResetPasswordModel m)
        {
            if (ModelState.IsValid && m.Validate())
            {
                var user = Membership.GetUser(m.username);

                if (user.ChangePassword(user.ResetPassword(),m.NewPassword))
                {
                    return RedirectToAction("ChangePasswordSuccess");
                }
                else
                {
                    ModelState.AddModelError("", "出错啦,联系管理员");
                }
            }

            // If we got this far, something failed, redisplay form
            return View(m);
        }
Beispiel #2
0
 public ActionResult ResetPassword(string username, string k)
 {
     var m = new ResetPasswordModel() { username = username, k = k };
     return View(m);
 }