Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 785253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:50:48+00:00 2026-05-14T20:50:48+00:00

I am working on an ASP.NET 2.0 web solution which currently runs en-GB and

  • 0

I am working on an ASP.NET 2.0 web solution which currently runs en-GB and zh-HK languages as the 2 current languages for the site. Others will be added at a later date.

One of the requirements is that the user can choose to override the language displayed to another language. Therefore users in Hong Kong can view the site in English and vice versa.

My 2 resource files are

  • Resources.resx (for English – default translations)
  • Resources.zh-HK.resx (for Chinese)

The site performs this logic

  1. Load user details
  2. Check if user has overridden the preferred language
  3. If they have, set the Thread.CurrentThread.CurrentUICulture to this language.
  4. If they haven’t, use the browsers default.

This is implemented in the following code:

//This method is written in a base page, which all pages in the site derive from
protected override void InitializeCulture()
{ 
    User user = /*Load custom user object...*/;
    string threadLanguage = Thread.CurrentThread.CurrentUICulture.IetfLanguageTag;

    //If the browser is using a different language, 
    //but the has chosen a preferred language, 
    //change the CurrentUICulture over.
    if (!threadLanguage.Equals(user.Language, StringComparison.OrdinalIgnoreCase))
    {
        CultureInfo userLanguageCulture = CultureInfo.CreateSpecificCulture(user.Language);
        Thread.CurrentThread.CurrentUICulture = userLanguageCulture;
    }

    base.InitializeCulture();
}

I have also configured the web.config to pick up the uiCulture automatically with

<globalization uiCulture="auto"/>

For some very very odd reason, some users (even en-GB users) are finding the language is switching over the zh-HK for no reason whatsoever – sometimes between pages! I have added some debugging code to these pages which should reveal more information in the coming days. All it has revealed so far is that users are not necessarily from zh-HK, some are from zh-CN or zh-TW. Although this might help, because en-GB users are seeing zh-HK I think it is just a red herring.

What I have noticed is that the switch over occurs on page content (those inheriting from the base page, which the IntializeCulture() method exists). The custom user controls I have written do not experience this problem and appear in the correct language configured by the user. Therefore a page would have combinations of both English and Chinese content – eek!

Can anyone give guidance as to if I am coding this correctly, or an alternative way of approaching the requirements.

Thanks in advance,

Dominic

P.S. This is an intermittent problem and not a permanent. There seems to be no common action that replicates this issue. It just – happens.

P.P.S Here is an image of the problem in action:

Web page showing Chinese/English problem


Update 23 Sep 09:

After trying to change it to Page.Culture, I am still having more intermittent problems.

I have a couple of ideas at why this could possibly be occurring, but am unable to justify my ‘hypothesis’:

  • We are using IIS 5.0 Isolation Mode, meaning only aspnet_wp.exe is running and not w3wp.exe for each IIS instance.
  • Reporting Services is also running on the server, generating reports for Hong Kong.
  • The fault occurs more frequently when the site was under heavy load – I assume due to large reports being generated.

Apart from that, I do not know what else could cause the problem. I would show another screenshot, but the problem is identical and did appear in the same place as the previous screenshot showed.

Update 25 Sep 09:

I think we I might have solved it. In our Web.config, there is a tag that was configured as follows:

<globalization uiCulture="auto" culture="auto"/>

After removing that, after initial testing, it has yet to turn up!

Update 13 Oct 09:

The problem has turned up again 🙁

Update 26 Oct 09:

It seems that if another user of the site changes their preferred language, it affects all other users on the site! Although their preferred language is set, somehow someone else’s language switch affects the other users of the site!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:50:49+00:00Added an answer on May 14, 2026 at 8:50 pm

    After a long, long time I finally worked out why this problem occurred.

    The site started off as a frameset.asp, hosting 3 .NET frames – top, middle, bottom. What I noticed, is that .NET generated 3 sessions, and therefore any changes only affected one frame.

    In a way, it doesn’t completely explain why only parts of the page were working, but it has resolved quite a few issues regarding some of the odd Repsonse.Redirects we were going.

    In summary, the frameset.asp, was replated with a frameset.aspx, which generates a single cookie / Session ID for all frames.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on an Asp.net MVC Web application. In my solution, there're two
I'm working on an ASP .NET 2.0 site which uses a Web Application project
I am currently working on a prototype ASP.NET MVC 3 solution that will be
I am working on an asp.net web site that is based upon a single
I am working on a ASP.Net web forms application which I inherited from a
I am working on a ASP.NET MVC web site that has multiple submit buttons.
I'm working on a Website Project (as opposed to an ASP.NET Web Application) which
I'm currently working on some web services network (ASP.NET 3.5 web services). My business
I am currently working on an web application that uses ASP.NET 2.0 framework. I
I'm working on an ASP.NET solution with 2 projects. One is the web interface

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.