MessageTemplateResourceName with custom resource manager

Topics: Validation Application Block
Nov 11, 2008 at 10:41 PM
Hi,

I am using the validation application block and want to use the MessageTemplateResourceType and Name properties to specify a resource which contains the localized messages.  Is it possible to have theses properties use a custom resource manager instead of the standard .Net ResourceManager? If so, could you point me in the right direction to some documentation on how to do this?

Thanks,
MG
Nov 12, 2008 at 5:54 AM
Edited Nov 12, 2008 at 6:02 AM
Is your intention for using a custom resource manager is for you to be able to retrieve a localized message which is not based on the thread's current culture?  I don't see any way how you're going to specify a different custom resource manager without modifying the source code.  The ResourceManager class has an overload for the GetString method which allows you to pass a cultureinfo object.  Or are you storing your localized strings in a file aside from a .resx file? Are you using a custom validator?  Sorry, I'm not sure if I interpreted your question correctly.


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

Nov 12, 2008 at 3:41 PM
Hi,

We want to store are resources within a database instead of a .resx file and we are going to build a custom resource manager to acces those resources.  We are trying to avoid modifying the EL source code so we were wondering if there is any way to configure EL to use the custom resource manager instead of uing the standard ResourceManager? We will be using the built-in validators for the Validation Application Block.  I hope this clarifies and thanks for the help.

Thanks,
MG
Nov 13, 2008 at 12:56 AM
If that's the case, the only way I think is for you to use custom validators and just have them inherit from the built-in validators and just override the properties for getting the message. The source code explicitly uses the ResourceManager class for retrieving localized strings and there's no property which you can set to specify a custom resource manager. 



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