Click here to Skip to main content
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 OriginalGriff 295
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 George Jonsson 170
0 OriginalGriff 5,415
1 DamithSL 4,422
2 Maciej Los 3,820
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,911


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 16 Jul 2010
Copyright © CodeProject, 1999-2014
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