ValidationAttribute class is included in DataAnnotations namespace. It helps you to validate model data received from user. It gives you many in built validation attributes like StringLength, Required, DataType for validating model.
- Customer Details View - html view having Customer details.
- Model Class with Custom Validation - has implemented ValidationAttribute class to achieve custom validation of Join Date of Customer.
- Customer Model - with custom validation attribute used for JoinDate property.
Below picture show implementation of Custom Validation attribute
For more details visit - Custom Validation Attribute in ASP.NET MVC