public AjaxContinuation Post(ChangePasswordModel model) { var user = _userService.GetUserByLogin(model.UserName); var notification = new Notification(); if (user == null) { notification.RegisterMessage(StringToken.FromKeyString("User Name", "User name does not exist!")); } else { try { user.ChangePassword(_passwordService, model.OldPassword, model.Password); } catch (Exception ex) { notification.RegisterMessage(StringToken.FromKeyString("Password", ex.Message)); } } return (notification.IsValid() ? AjaxContinuation.ForNavigateWholePage("/account/logoff") : AjaxContinuation.ForError(notification)); }