Changing Culture of the aspx page. RRS feed

  • Question

  • User-1917713218 posted

    Hello All,

    I need to change culture of the specific aspx page bases on the main user's culture.

    I am able to fetch the data that which culture main user have.

    But some how I am not able to set the same culture for that aspx page.


    I had written the below code for that.

    string CurLanguage = "sv-SE";                   
    System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(CurLanguage); System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CultureInfo.CreateSpecificCulture(CurLanguage); Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(CurLanguage); Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.CreateSpecificCulture(CurLanguage); Page.Culture = CurLanguage;

    But that is not working it sets the default culture of the browser.

    Please suggest me appropriate solution.

    Tuesday, November 23, 2010 4:28 AM


  • User1508394307 posted

    // Display the Current Culture
    Response.Write("Current Culture is " + Thread.CurrentThread.CurrentCulture.EnglishName + "<br>");
    // Modify the Current Culture
    Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
    Response.Write("Changing Culture to " + Thread.CurrentThread.CurrentCulture.EnglishName + "<br>");

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 23, 2010 5:13 AM