Referencing a resx from an aspx?

T

theintrepidfox

Dear Group

Just wonder if someone can point me in the right direction please?
I have a label control and want to assign a string in a resource. I'm
sure I'm on the right track but it doesn't work. The resource and
string is in place.

<asp:Label ID="LaSysNavFooter" runat="server" Text='<%#
Resources.framework.global.aspx.LaSysNavFooter%>'></asp:Label>

Thanks very much for your help & efforts!

Martin
 
P

prabhupr

The way we did was

1. In the ASPx page this is how the code looks
<asp:Literal runat="server" ID="Literal2" Text="<%$
Resources:SeeAllFeaturedFeeds %>"></asp:Literal>
2. In ".cs" file, having "using System.Globalization;"
3. Create a folder "App_LocalResources" (I guess name really matters)
4. Have files name like "Default.aspx.resx",
"Default.aspx.de-DE.resx"..... The file name should match your ASPx
file name
I'm pretty sure, you can keep all resources in single file rather
than having one RESx for each ASPx file (I dont know HOW though)

Hope that helps.
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top