Globalozation Problem in web.config file

Topics: Validation Application Block
Jun 17, 2009 at 11:43 AM


I am Using Validation Application block In My Application for Country Specific validation .So i need to display the messageTemplate Content from My GlobalMessages.resx File.

The Following code Is In Web.Config

<validator negated="false" messageTemplate="Consignor's Country Code is Required!"
              messageTemplateResourceName="" messageTemplateResourceType=""
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.NotNullValidator, Microsoft.Practices.EnterpriseLibrary.Validation, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              name="Not Null Validator" />



Prasad A

Jun 17, 2009 at 11:54 AM
Edited Jun 17, 2009 at 12:09 PM

You have to specify the messageTemplateResourceType and messageTemplateResourceName and not the messageTemplate property.  If you use the Enterprise Library Configuration Tool, you'll be able to easily load the resource type by clicking on the ellipsis button on the MessageTemplateResourceType property.  It will open up the type selector and you should be able to load the assembly where the resource file is.  The messageTemplateResourceName corresponds to the Key of the resource entry you want to use.

 If you simply want to type it using the xml editor, type assembly type name where the resource is.

Sarah Urmeneta
Global Technology & Solutions
Avande, Inc.



Aug 29, 2009 at 3:58 PM
Edited Aug 29, 2009 at 6:47 PM


I have a problem to use the file resx , because the validator doesn't bind the right resources ; I have a test web app. with one page and a button in it . This button call a business method stored in another project ( where is businness logic) .

into the business logic project, I use the validation Block and then  I have set the resource files ( resource1.resx and resource1.en-US.resx ) in this project .

Well, I set with "enterprise library configuration" the web.config file into test web app, but when I read the Validationresult returnes ,is still the message standard .

Into the MessageTemplateResourceTypeName field I tried to change the namespace syntax , but without success...

where I'm wrong  !!


Note :

the webApp name is : AJAXEnabledWebApplication1

the BLL project name is : BLL  ( included into it there are resource1.resx and resource1.en-US.resx files)

into the enterprise library configuration,I tried to change the MessageTemplateResourceTypeName field value with :




but nothing

 I read many post where is clear there is a problem but I don't understand how to manage it 

Please, any solution 





Aug 31, 2009 at 8:05 AM

"...I saw the light..." ( The Blues Brothers )

I knew that the syntax was wrong.... here the right
BLL.My.Resources.Resources, BLL, Version=, Culture=neutral, PublicKeyToken=null
Thanks to all