Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Updated 15-Jul-10 2:20am
v2

Have you looked into the Resource Expression Builder Syntax?

]]>

http://www.123aspx.com/redir.aspx?res=35521[^]
 
Share this answer
 
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.
XML
<asp:Label ID="ID_ALERT" runat="server" Text="Alerts" meta:resourcekey="res_NAVI_ALERTS"></asp:Label>
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900