This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi,
|
|
|
Derive a class from ValidationAttribute. For most custom validations, you'll also need to implement a custom ValidationRule, the main action of which occurs in the Validate method. I've attached a simple example. You'll need a current nightly build of LightSpeed to compile it as written; if you don't want to upgrade to a nightly build, then just remove the 'this' argument as specified by the comment where the compiler error occurs. I haven't supplied database scripts because the sample doesn't actually hit a database -- instead I call Validate() manually. This isn't normally required because LightSpeed does it when you call SaveChanges(). This is NOT specific to custom validations -- it's just a trick to avoid having to set up a database for the sample! Let me know if you run into any problems or need me to go into any more detail. I'll ask our screencast guy to add it to his to-do list as well. |
|
|
Thanks Ivan, if that is the support of Mindscape, I'll be very happy with it. :D |
|