Base solution for your next web application
Open Closed

Reset Password Form error. #3519

velu created
  1. When I use UserFriendlyException In AccountController.cs (Reset Password ActionResult) is shows error instead of Popup.

Please suggest me necessary changes for this bug.


var user = await _userManager.GetUserByIdAsync(userId);
            if (user == null || user.PasswordResetCode.IsNullOrEmpty() || user.PasswordResetCode != model.ResetCode)
          Error --->      throw new UserFriendlyException(L("InvalidPasswordResetCode"), L("InvalidPasswordResetCode_Detail"));

            //Check Password History
            var passwordHistory = await _PassWordHistoryRepository.CheckLastPassword(model.Password, tenantId , userId);
            if (passwordHistory.Isexist)
               Error --->   throw new UserFriendlyException("Your password is matching with \n the last " + passwordHistory.controlValue + " history password.");

1 Answer(s)
  • 0
    alper created
    Support Team


    first of all reset password is not ajax method. aspnetboilerplate framework handles user friendly exceptions for non-ajax methods as well. you are seeing the developer error page because you have not configured CustomerErrors Mode = On after you set custom errors on, you can see a friendly ui.

    Please read handling exceptions for more information: <a class="postlink" href=""> ... Exceptions</a>

            <customErrors mode="On"/>