ASP.NET 2.0 : Explicit localization expression

O

Olivier Matrot

Hello,

I'm trying to use explicit localization expression to access global
resources from an .inc file that's included into several ASPX pages.

I may be wrong in my expression, bu accessing Local resources is working
well indeed. Here is the code :

.....
<asp:Localize runat="server" id='myid' text="<% $ Resources
sharedStrings,title_inc%>">some text</asp:Localize>
.....

Where 'sharedstrings' is the name of a global resource file and 'title_inc'
is the string Name.
In the resource file, we could find a string named "title_inc.Text".

TIA.
 
S

Steven Cheng[MSFT]

Hi Olivier,

Welcome to ASPNET newsgroup.
As for the accessing resource strings in global resource files, we can also
make it in the inline aspx databinding expression. For example:

<asp:Label ID="ColumnCurrency" runat="server" Text='<%#
(string)GetGlobalResourceObject("CurrencyNames",(string)Eval("Region")) %>'
meta:resourcekey="LabelResource4"></asp:Label>

Here is related the reference on MSDN 2 site:

http://beta.asp.net/QUICKSTART/util/srcview.aspx?path=~/aspnet/samples/local
ization/LocalizeImpExp.src&file=LocalizeImpExp_cs\LocalizeImpExp_cs.aspx

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Olivier Matrot" <[email protected]>
| Subject: ASP.NET 2.0 : Explicit localization expression
| Date: Thu, 25 Aug 2005 17:00:36 +0200
| Lines: 20
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: reverse.completel.net 213.30.138.178
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:120270
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello,
|
| I'm trying to use explicit localization expression to access global
| resources from an .inc file that's included into several ASPX pages.
|
| I may be wrong in my expression, bu accessing Local resources is working
| well indeed. Here is the code :
|
| ....
| <asp:Localize runat="server" id='myid' text="<% $ Resources
| sharedStrings,title_inc%>">some text</asp:Localize>
| ....
|
| Where 'sharedstrings' is the name of a global resource file and
'title_inc'
| is the string Name.
| In the resource file, we could find a string named "title_inc.Text".
|
| TIA.
|
|
|
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top