public ActionResult ResetUserPassword(UserVM model) { ViewBag.UnSuccessMessage = null; ViewBag.SuccessMessage = null; try { if (!ModelState.IsValid) { ViewBag.UnSuccessMessage = "Please enter password."; return(View("AddSupportQuery", model)); } else { if (!string.IsNullOrEmpty(model.Password)) { model.Password = Common.EncryptedPassword(model.Password); UserVM _userVM = _userBLL.ResetPassword(model); TempData["SuccessMessage"] = "Password has been updated successfuly."; return(RedirectToAction("ResetUserPassword")); } else { return(View("ResetUserPassword", model)); } } } catch (Exception ex) { ViewBag.UnSuccessMessage = "Please goto forgot password process again. Some error has occurred. Error is: " + ex.Message; } return(View("ResetUserPassword")); }