The text of this article is not in this database — only its details are. Read it on the old site: Creating Custom Validation Attribute For Data Annotation
5 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.

spy spiderPosted Oct 4, 2018, 7:46 AM
You source code is corrupted though
Nilesh MakavanaPosted Aug 4, 2018, 3:16 PM
How to perform data annotation for multiple company, let say I have two company where i have one filed for company A is mandatory, and same filed is non-mandatory for company B. I tried all but the issue is the first loaded validation only works, for another company the model validation only not goes in debug. please suggest what to do.
Jignesh TrivediPosted Jun 28, 2012, 12:56 AM
Yes Gaurav. Its really good idea beacuse the Data Annotation validators is that they enable us to perform validation simply by adding one or more attributes like the Required or String Length attribute – on the class property. this will help to reduce code size as well as code reusability. Also MVC, EF and WCF inbuilt support for this.
Gaurav GuptaPosted Jun 28, 2012, 12:43 AM
Is Data Annotations really a good idea for validation?