How to disable Client Side Validation from EditorFor directly ?
I have this code in my Model
[Display(Name = "Correo", ResourceType = typeof(UsuarioRNECRESX))]
[Required(ErrorMessage = null, ErrorMessageResourceName = "CorreoRequerido", ErrorMessageResourceType = typeof(UsuarioRNECRESX))]
[EmailAddress(ErrorMessage = null, ErrorMessageResourceName = "CorreoFormato", ErrorMessageResourceType = typeof(UsuarioRNECRESX))]
public string Correo { get; set; }
I would like in some cases disable the EmailAddress validation in some EditorFor like this,
@Html.EditorFor(m => m.Correo, new { cols = "100", rows = "5", ngModelParent = "usuario"})
How could I do this from view ?
I've tried this
Html.EnableClientValidation(false);
Html.EnableClientValidation(true);
but that code disable all validations.