public ActionResult ResetPassword(string id , string newpassword , string confirmpassword) { ViewBag.Id = id; if (!string.IsNullOrEmpty(id)) { ViewBag.IsTokenValid = accessController.IsPasswordRequestTokenValid(id); if (!(string.IsNullOrEmpty(newpassword) || string.IsNullOrEmpty(confirmpassword))) { if (newpassword.Equals(confirmpassword)) { PasswordResetRequest request = new PasswordResetRequest { Token = id, NewPassword = newpassword }; try { bool isResetSuccess = accessController.ResetPasswordFromToken(request); ViewBag.PasswordResetSuccess = true; } catch (Exception excp) { ViewBag.Error = excp.Message; } } else { ViewBag.Error = "New password and Confirm password does not match"; } } else { ViewBag.Error = "New password or confirm password cannot be blank"; } } return(View()); }