Click here to Skip to main content
11,478,619 members (63,858 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Embedded ASP.NET
Hi,

I have a asp.net project with tons of websides. Many of these websides aspx/ascx consists of lines like this:

<asp:Label ID="ID_ALERT" runat="server" Text="Alerts" meta:resourcekey="res_NAVI_ALERTS"></asp:Label>

Al in all the resources are found correctly under the App_LocalResources directory.

I then have changed the build action from all the resource from content to embedded resource.
What I saw now is that new directories under the bin folder are created like fr for french etc. Inside these directories I can see the *resource.dlls.

My question now is how can I make the asp:lable above to make use of the resource dll I have created? As far as I can see the mechanism still depends of the resx files under App_LocalResources directory.

I know that the below mechanism would work e.g.

<a href='/my/About.aspx'>my Default<%=myNameSpace.GlobalResMgr.GetString("my_menu","my_res101")%></a><img width='8' height='18' alt='' src='/my/images/header_divider.png'/>
That means defining a private methode to pick up the resources. This mechanism will also work for dll resources.

But isnt there a trick to make use of resource dll's inside these asp:lables?

Thanks in advance
Achim
Posted 15-Jul-10 3:13am
Edited 15-Jul-10 3:20am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Have you looked into the Resource Expression Builder Syntax?

<![CDATA[<%$:Resource: GlobalResource, Key %>]]>

http://www.123aspx.com/redir.aspx?res=35521[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

thanks for the reply. I have looked into the expression builder syntax.
I think its possible to create my own resource expression builder and read from the resource dll.

What I dont like is that when switching the aspx to designer view there is no default text displayed. Is there a way to do this also?
The below line is working well in designer view, since the default text is displayed.
<asp:Label ID="ID_ALERT" runat="server" Text="Alerts" meta:resourcekey="res_NAVI_ALERTS"></asp:Label>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 289
1 F-ES Sitecore 170
2 Frankie-C 120
3 OriginalGriff 105
4 DamithSL 95
0 Sergey Alexandrovich Kryukov 7,865
1 OriginalGriff 7,341
2 Sascha Lefèvre 3,059
3 Maciej Los 2,491
4 Richard Deeming 2,335


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 16 Jul 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100