public EditProfileViewModel() { AccountInfoViewModel = new AccountInfoViewModel(); CreditCards = new HashSet<CreateCreditCardViewModel>(); CreateCreditCardViewModel = new CreateCreditCardViewModel(); ResetPasswordViewModel = new ResetPasswordViewModel(); }
public ActionResult ChangePassword(ResetPasswordViewModel vm, FormCollection form) { var memberName = User.Identity.Name; var currentPassword = vm.CurrentPassword; var newPassword = vm.Password; if (WebSecurity.ChangePassword(memberName, currentPassword, newPassword)) { TempData["toast"] = "<script> $(document).ready(function () {" + "toastr.options = { 'positionClass': 'toast-bottom-right' };" + "toastr.success('Your password was successfully changed!');});</script>"; return RedirectToAction("Details", "Member", new { id = memberName }); } ViewBag.toast = "<script> $(document).ready(function () {" + "toastr.options = { 'positionClass': 'toast-bottom-right' };" + "toastr.error('Error changing your password. Please try again.');});</script>"; return View(vm); }