Adam Schroder

Its Schotime.com!

Custom Validation Attributes

In my last post I showed you how to use Validation attributes on your model for validation. Today I will show how you can create your own attributes that can provide custom validation for you.

To accomplish this we need to inherit from ValidationAttribute. We'll create an attribute today that will only allow a "Yes" or "No" value to be entered. A pretty bad example however it will still suffice.

Click here to see the how its done.

Adam

Posted: Mar 10 2009, 09:12 PM by schotime | with no comments
Filed under: , , , ,

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)