Click here to Skip to main content
11,645,087 members (69,896 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 2:13am
Edited 15-Jul-10 2: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 700
1 jyo.net 494
2 Sergey Alexandrovich Kryukov 439
3 Afzaal Ahmad Zeeshan 404
4 CPallini 386
0 OriginalGriff 1,065
1 Sergey Alexandrovich Kryukov 683
2 DamithSL 681
3 Afzaal Ahmad Zeeshan 662
4 CPallini 555


Advertise | Privacy | Mobile
Web01 | 2.8.150731.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