public JsonResult ChangePassword(UserChangePasswordModel userchangemodel)
        {
            if (!ModelState.IsValid)
                return Json(new JsonResponse("Invalid Data", "Please provide correct details for page"));

            var getUser = _repoUsers.DbContext.Users.FirstOrDefault(usr => usr.UserName == userchangemodel.UserName);
            if (getUser == null)
                return Json(new JsonResponse("Invalid User!", "Invalid user name."));

            var lstUserModel = GetListingModel();

            if (WebSecurity.ChangePassword(userchangemodel.UserName, userchangemodel.Password, userchangemodel.NewPassword))
            {
                return Json(new JsonResponse(
             new
             {
                 UserList = RenderPartialViewToString("List", lstUserModel)
             })
                {
                    Message = "Change Password!",
                    Description = "Change Password Changed Successfully."
                });
            }
            else {
                return Json(new JsonResponse("Invalid Password!", "Your password is not correct."));
            }
        }
        public ActionResult ChangePassword(int id = 0)
        {
            //if (!WebSecurity.IsAuthenticated && !Roles.IsUserInRole("SuperAdmin"))
            if (!CommonUtility.CheckUserLogin())
            {
                RedirectToAction("Login");
            }

            UserChangePasswordModel userChangeModel = new UserChangePasswordModel();
            if (id != 0)
            {
                User user = db.Users.Find(id);
                if (user == null)
                {
                    return HttpNotFound();
                }
                userChangeModel.UserName = user.UserName;
            }
            else
            {
                userChangeModel.UserName = WebSecurity.CurrentUserName;

            }
            if (CommonUtility.IsUserEditPermission(userChangeModel.UserName))
            {
                RedirectToAction("List");
            }
            return View(userChangeModel);
        }
 public ActionResult ChangePassword(UserChangePasswordModel userchangemodel)
 {
     if (ModelState.IsValid)
     {
         if (WebSecurity.ChangePassword(userchangemodel.UserName, userchangemodel.Password, userchangemodel.NewPassword))
         {
             return RedirectToAction("List");
         }
         else {
             userchangemodel.message = "Your password is not correct";
             return View(userchangemodel);
         }
     }
     else {
         return View(userchangemodel);
     }
 }