asp2: setting UICulture via code does not work any more (always german Resources)?

asp2: setting UICulture via code does not work any more (always german Resources)?

Post by Roland Mle » Tue, 22 Nov 2005 16:50:59


Hello,

we have converted our project to framework 2.0 but we have still some
problems, one of it with setting the UICulture for a aspx-site.

Example: there is a simple aspx test site in a solution with two resx
files in the App_GlobalResources folder:

- ffTest.en.resx
- ffTest.resx

Both contain a testkey/testvalue "String1".
I have a label:
<asp:Label ID="test1" runat="server" Text="<%$ Resources:ffTest, String1
%>"></asp:Label>

If i set the UICulture in the Page directive (i try "de-DE" and "en-GB")
the page shows the correct text, in german and in english (according to
the setting in the Page directive).

But i MUST do this via code as in framework 1.1, i try both of the
following in Page_Load:

System.Threading.Thread.CurrentThread.CurrentUICulture = new
System.Globalization.CultureInfo("en-GB");

OR

Page.UICulture = "en-GB";

But the lable always shows the german value of the resource file!!!!!!!!

What do i wrong?
Thanks, Roland