473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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

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.CurrentUICul ture = 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
Nov 21 '05 #1
1 1356
Found a solution, do:

protected override void InitializeCulture() {
System.Threading.Thread.CurrentThread.CurrentCultu re = new
System.Globalization.CultureInfo("en-GB");
System.Threading.Thread.CurrentThread.CurrentUICul ture = new
System.Globalization.CultureInfo("en-GB");

base.InitializeCulture();
}

Roland Müller wrote:
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.CurrentUICul ture = 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

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: relaxedrob | last post by:
Howdy All! I am really stuck with this one - I want to completely create a table within JavaScript and insert it into the document, with onMouseOut and onMouseOver handlers in the table rows. ...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
2
by: Hardy Wang | last post by:
Hi, We migrated some of web applications to a new server. When the server was installed, the regional setting was EN-CA, later on we found culture display was not same as from original server...
1
by: Klaus Jensen | last post by:
Hi This question relates to ASP.Net 1.1 - NOT 2.0 I want to set a site-wide UIculture from code. I know it can be set in web.config, but can it be set in code? For instance in...
3
by: Laith Zraikat | last post by:
I need to set the page title for a content page in a master page, and do that using local reources so that I can have my page title in different languages. I can do that easily using global...
1
by: יוני גולדברג | last post by:
Hi, I've developed few asp 1.1 application, now I'm about to develop my first asp2.0 appliation. I'm afraid to use old techniques so I want to focus and learn the best Asp2.0 techniques. How do...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
by: kidders | last post by:
Seem to be having problems with the en-GB culture/uiCulture setting, its making dates a format of the incorrect MM/dd/yyyy. I've searched the groups on this issue, here is a lengthy thread, where...
1
by: Cindy Lee | last post by:
My browser always shows the en-US local resource file, even though I try to set it to my french resource file: (this is the first part of onPageload--) Thread.CurrentThread.CurrentCulture = new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.