Localized strings with SelfValidation

Topics: Validation Application Block
Jun 6, 2010 at 8:22 AM

Hi,

How can I provide a template resource name and a template resource type for methods that are decorated with the [SelfValidation] ?

Adding a validation result doesn't seem to offer much options in this department. Any pointers?

 

 validationResults.AddResult(
                            new ValidationResult(
                                "No value entered",
                                this,
                                "NoValue",
                                null,
                                null));

 

 

Jun 7, 2010 at 1:28 AM

To get around that, create a helper method which takes the parameters for the resource name and resource type and returns the localized message.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@Avanade.com