Way to change the message on CommonRules

Way to change the message on CommonRules

Old forum URL: forums.lhotka.net/forums/t/2385.aspx


boo posted on Monday, February 19, 2007

We need to give different messages on errors but I'd like to make use of the built in common rules for a lot of the rules but don't see an overload where you can customize the method...is there a way to do this?

RockfordLhotka replied on Monday, February 19, 2007

They are static/Shared methods, so there's no way to override them or anything like that.

Frankly, they are examples. If you like them, use them. If you don't like them, create your own library of rule methods.

Every now and then people send me new rules, and that's fine. But I don't intend to expand CommonRules beyond where it is (with the possible exception of adding StringMinLength), because I don't want to get in the business of maintaining a huge library of rules.

What I keep hoping will happen is that there'll be a CslaContrib.dll that includes CslaContrib.Validation.CommonRules on the codeplex site - that'd be a nice home for a broader library of rule methods, and I wouldn't have to maintain them Smile [:)]

Copyright (c) Marimer LLC