Customize error message for Validation.CommonRules

Customize error message for Validation.CommonRules

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


vijay posted on Monday, April 28, 2008

Hello,

I have implemented some validation rules like: StringRequired, RegExMatch, StringMinLength... When the validation rule fails on supplied data it seems it is showing default error message. How can i show my error message instead of what comes from CSLA?

Thanks.

JoeFallon1 replied on Monday, April 28, 2008

Create your own set of rules. Use your own namespace.

You can simply start by copying the CSLA rules and then modify them to meet your needs. Because they are in different namespaces, you will not have a conflict.

Then as you create your own common rules you have a place to put them. BO specific rules can stay strongly typed in the BO that needs them.

Joe

Copyright (c) Marimer LLC