troubleshooting Question

Set culture in VS 2008 development server vs production erver

Avatar of RTSol
RTSol asked on
Web DevelopmentASP.NETWeb Applications
2 Comments1 Solution803 ViewsLast Modified:
Hi,

I am developing a web application in which the user can select the language (culture). My problem is that when i select the culture in my development environment (VS 2008 SP1 on a Vista Business machine) the login controls, such as the login status and the login, automatically change their langauge. However, when I deploy the site to a production server (I have tested SBS 2008 with IIS7 and WS 2003 with IIS6) this doesn't happen. I have been strugling a while with this - please help. I have supplied the culture setting code.

Best regards
RTSol
protected override void InitializeCulture()
    {
        // override virtual method InitializeCulture() to check if session contains a language setting
        if (Session["PreferredCulture"] != null)
        {
            string UserCulture = Session["PreferredCulture"].ToString();
            if (UserCulture != "")
            {
                System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(UserCulture);
                System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(UserCulture);
            }
        }
        else
        {
            string UserCulture = ConfigurationSettings.AppSettings["ApplicationCulture"].ToString();
            System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(UserCulture);
            System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(UserCulture);
        }
    }
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros