Asp.net: deploying local resources - is deployment possible?

I have an asp.net application with some local resources. These resources are used in aspx and code-behind files:

aspx:
<asp:TextBox ID="TextBox1" runat="server" Text="<%$ Resources:testTag %>" />

.vb:
TextBox1.Text = GetLocalResourceObject("testTag").ToString

      

If I deploy the .resx files with the application, no problem.

However, if I change the build action in the resx file to "Embedded Resource", the resources are not available even if they are in the DLL that is being created.

Is it possible to deploy resources to a DLL, or am I stuck with managing and deploying resx files on the server?

0


a source to share


1 answer


Yes it is possible.

Check this example code . It's a little old, but still valid.

Another example, from microsoft, is here .



UPDATE

To be honest, I haven't gotten that far with our own localizations yet (we still use the usually built-in resource files); however here is a link to an example on how to access the resource manager from your aspx page. This is the last post in this thread.

GeorgeZ sets the resource manager loading in the page_init method. I'm sure you can put this in some kind of BasePage that all of your pages inherit so you don't have it directly in all your codes.

0


a source







All Articles