Click here to Skip to main content
14,427,342 members
Rate this:
Please Sign up or sign in to vote.

I have a 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
Updated 15-Jul-10 3:20am
Rate this:
Please Sign up or sign in to vote.

Solution 1

Have you looked into the Resource Expression Builder Syntax?

Rate this:
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>

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

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