By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,864 Members | 1,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,864 IT Pros & Developers. It's quick & easy.

Localisation with RESOURCE: in aspx pages need resx files no dll

P: n/a
WT
Hello,

Could we use 'Embedded resources' with resx files that contain text
resources used in aspx pages with the syntaxe:
Text="<%$ Resources:ResourcesMy,KEY1 %>"

I tryed removing the App_GlobalResources folder, and after verifying thta my
resources were correctly embedded in my dll, I get errors as if asp.net was
unable to look for these ressources in the assembly, still trying to open an
resx file

InitializeDataSourceLoadControl controlPath :
/WTPageModules/Pages/PortalPagesManager.ascx, ex :
System.Web.HttpParseException: The resource object with key 'AM_TABS' was
not found. --->
System.Exception: The resource object with key 'AM_TABS' was not found. --->
System.Web.HttpException: The resource object with key 'AM_TABS' was not
found.

Is there any solution to have dlls and no resx files deployed ?

Thanks

CS
Apr 30 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi CS,

From your description, what you want to do is using the localization
resources defined in a class library assembly(rather than the
App_LocalResource or App_GlobalResource) in your ASP.NET 2.0 page, correct?

Based on my understanding, ASP.NET 2.0 web page's localization directive
(<%$Resource %>) can only reference resource items defined in either
App_LocalResource or App_GlobalResource's resource files. To use resource
items in a separate .net assembly, you may need to manually load the
resource through resource API(such as resourceManager ...)

http://msdn2.microsoft.com/en-us/lib...03(VS.71).aspx

Also, for ASP.NET 2.0 application, if you perform precompilation for your
web application, those resource files in App_GlobalResource and
App_LocalResource can be precompiled into assemblies. Is this possible to
help avoid using separate assembly to store resource?

In addition, if you do have to store resource in class library, you can
consider create a custom expression build that encapsulate the code logic
of retrieving resource from external resource file or assembly and use your
custom expression in ASPX template. here is a msdn article introducing this:

#Extending the ASP.NET 2.0 Resource-Provider Model
http://msdn2.microsoft.com/en-us/library/aa905797.aspx

And another good article about custom expression builder in ASP.NET 2.0:

#The CodeExpressionBuilder
http://weblogs.asp.net/infinitiesloo...odeExpressionB
uilder.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 1 '07 #2

P: n/a
WT
Yes, thats what I was looking for, thanks.
CS
"Steven Cheng[MSFT]" <st*****@online.microsoft.coma écrit dans le message
de news: EC**************@TK2MSFTNGHUB02.phx.gbl...
Hi CS,

From your description, what you want to do is using the localization
resources defined in a class library assembly(rather than the
App_LocalResource or App_GlobalResource) in your ASP.NET 2.0 page,
correct?

Based on my understanding, ASP.NET 2.0 web page's localization directive
(<%$Resource %>) can only reference resource items defined in either
App_LocalResource or App_GlobalResource's resource files. To use resource
items in a separate .net assembly, you may need to manually load the
resource through resource API(such as resourceManager ...)

http://msdn2.microsoft.com/en-us/lib...03(VS.71).aspx

Also, for ASP.NET 2.0 application, if you perform precompilation for your
web application, those resource files in App_GlobalResource and
App_LocalResource can be precompiled into assemblies. Is this possible to
help avoid using separate assembly to store resource?

In addition, if you do have to store resource in class library, you can
consider create a custom expression build that encapsulate the code logic
of retrieving resource from external resource file or assembly and use
your
custom expression in ASPX template. here is a msdn article introducing
this:

#Extending the ASP.NET 2.0 Resource-Provider Model
http://msdn2.microsoft.com/en-us/library/aa905797.aspx

And another good article about custom expression builder in ASP.NET 2.0:

#The CodeExpressionBuilder
http://weblogs.asp.net/infinitiesloo...odeExpressionB
uilder.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.

May 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.