public void displayMesssages(PasswordValidator.UserPasswordValidationResult result) { clearErrors(); var errors = result.errors; var message = ""; foreach (var error in errors) { message += ErrorMessages.passwordValidatorErrorMessages[(int)error]; message += "\n"; } if (!result.Valid()) markHasErrors(message); }