Accessing "Resources" from class libraries

R

Roger Helliwell

Hi gang,

I'm loving the new Resource features in Whitbey. No longer are there
any Button1.Text = "Click Here" lines in my code-behinds. All have
been replaced with Resources.Labels.ClickHere (Our site is in 3
languages).

But, is there a way to access the Resources namespace from another
class library? I've searched all through the HttpContext class for a
mention of it but no luck.

Thanks,
Roger
 
R

Roger Helliwell

Have a look @ System.Resources namspace

Hi Daniel,

Not sure what I'm after in that namespace. I've looked at
ResourceManager and ResourceSet, but so far no luck. Do I need to
physically load the .resx file using reflection or something similar?

Here's what I know so far...

Each .resx file in /Application_GlobalResources is translated to a
static class within the "Resources" namespace. So for example,
"Errors.resx" can be accessed using Resources.Errors.SomeErrorCode.
These classes exist in the web-application code space, so how can an
external class reference them without adding a reference?

Any further thoughts?

Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top