-1
I need help validating a field string[]
, because whenever I send this empty field, it returns error, even if it is in the correct format:
This is the field:
[RegularExpression(@"^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$", ErrorMessage = "E-mail está em um formato inválido.")]
[Display(Name = "E-mail")]
public string[] Email { get; set; }
This field will not always be filled in, but whenever I send it blank null
, it generates the error E-mail está em um formato inválido.
. It will be possible to send 1
to n
emails, I needed every email that was sent, validated by regular expression, would know how to help me ??
You managed to solve your problem?
– Leandro Angelo