RegEx error message

RegEx error message

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


gwilliams posted on Sunday, June 14, 2009

Has the framework been updated to allow a custom error message? Last post i saw on this was in 2006

rsbaker0 replied on Monday, June 15, 2009

As of CSLA 3.5 it had not been changed.

Can I second the request for a custom message?

As currently implemented, the rule doesn't provide feedback that tells the end user how to solve the problem, so I'd think a custom message would almost be a requirement rather than an option/enhancement.

ajj3085 replied on Tuesday, June 16, 2009

Well, it's easy enough for you to do this. Simply build your own rule which calls the RegEx rule. If the RegEx rule returns false, your rule could change the e.Description to whatever you want, like something from a DecoratedRuleArgs.

JoeFallon1 replied on Tuesday, June 16, 2009

I agree with Andy.
I do not use the CSLA rules directly. I consider them examples. I have my own Rule class (which started as a copy of the ones Rocky provided but has grown a lot since then.) I can make my own modifications without worrying about changes to the framework.

Joe

Copyright (c) Marimer LLC