How to Perform Custom Validations Using Data Annotations

ASP.NET MVC applications are able to use data annotation attributes to enforce validation on model properties. It provides a few data annotations that can cover frequently needed validations. But there are time where you need to perform custom variation to model properties. This article will show you how these tasks can be accomplished.

Data annotation attributes will allow you to validate model properties. You can create yur own data annotations by creating a class that inherits the ValidationAttribute base class. You can also add client side validation capabilities to a custom data annotation by implementing IClientValidatable interface.
Read the rest of the tutorial here:

Leave a Reply

Your email address will not be published. Required fields are marked *