I have this property and Data Annotations for it:
[Required(ErrorMessage = "Campo orbgiatório.")]
[RegularExpression("^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$", ErrorMessage = "The password must contain: \n * Pelo menos 8 caracteres; \n *Pelo menos uma letra. \n *Pelo menos um dígito. ")]
public string Password { get; set; }
I want to skip the lines of the error message between each password rule, so I'm using \ n , but it is not working. \ n only disappears and the message does not break the lines.