Dreamweaver using .resource files

D

Daniel

I am just investigating on .resx and .resource files using asp.net. I
am attempting to develop a webpage in Dreamweaver on an asp.net
webserver. As i read around the net, using a .resource file for all
my text on my website seems like the best way to go. I would just
have a fr.resource file for each language. This seems like it would
work pretty well. I have been able to create the .resource files but
i do not know how to read them to put on my website. Most of the
information i have been reading explains how to do this with VBstudio,
but i am using dreamworks. Can someone point me in the right
direction?
 
C

Cowboy \(Gregory A. Beamer\)

If this is page by page, you do the following:

1. Create a directory called App_LocalResources
2. Name the resource file for default.aspx default.aspx.resx
3. Use the following tag to get the value Header from this file (assuming a
name of HeaderText)

<%$ Resources:HeaderText %>

as in

<h1><asp:Label runat="server" Text="<%$ Resources:HeaderText %>"
id="Label3"/></h1>

For global resources

1. Create a directory called App_GlobalResources
2. Name the file something like GlobalResources.resx (name not as important
as matching the file name to the class name in the next step)
3. Use the following tag (note the GlobalResources class name as this is the
major change from local resources)

<%$ Resources:GlobalResources, HeaderText %>

as in

<h1><asp:Label runat="server" Text="<%$ Resources:GlobalResources,
HeaderText %>" id="Label3"/></h1>

Rule: ClassName = RESX file name.

If you do this, ASP.NET can be set up to automatically localize content when
you have the proper language resource files. You will have to add a
globalization tag to the web.config.

For a great intro, find Michele Leroux Bustamante's articles on MSDN. You
can also find her blog at www.dasblonde.com.
 
D

Daniel

That didn't work for me. My site just displayed "<%$
Resources:GlobalResources,
HeaderText %>" in <h1> format. My asp server compiles other code. Do
you know what the problem could be?
thanks!
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top