Type type="email" field despises Validationmessagefor Asp.net mvc?

Asked

Viewed 66 times

1

When you use this kind of field he despises ValidationMessageFor?

In class

[Required(ErrorMessage = "Informe o seu login.")]
[DataType(DataType.EmailAddress, ErrorMessage = "Por favor insira ...")]
[StringLength(50, ErrorMessage = "O número de caracteres permitidos é 50.")]
public string login { get; set; }

On the form

@Html.TextBoxFor(x => x.login, new { placeholder = 
     @Projeto.WEB.Celular.Resources.HomeText.txtRecuperaSenha, 
     @class = "form-control input-lg", type = "email", })
@Html.ValidationMessageFor(x => x.login)

inserir a descrição da imagem aqui

  • I believe that’s not it, see that I have the Datatype

  • I made the example, see in my question that is following the model, even so it uses the standard in English

  • The message does not agree with [Datatype(Datatype.Emailaddress, Errormessage = "Please enter ...")]

  • yes, but I think it’s okay, because Resources only has the text that’s inside the input

  • OK, yet I thank you

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.