Model:
public class Employee
{
public string Id { get; set; }
[StringLength(10, MinimumLength = 5)]
[Required]
public string Name { get; set; }
public string Email { get; set; }
[Range(1, 100)]
public int Age { get; set; }
}
I am new to asp.net MVC. I am providing the validations using Model data annotations.
My problem is that when UnobtrusiveJavaScriptEnabled
is false
in Web.Config
validations are no longer working even though ClientValidationEnabled
is set to true
?
Is Data Annotation only for Client Side because when I set ClientValidationEnabled
to false
, validatios are no longer working? I am really Confused.