Each user of my application will choose their country, after which it will be saved in a cookie and saved for future requests. Everything is working fine, but I need to establish a culture at the beginning of the session. I am currently experimenting by setting the culture in web.config as en-GB, and then using Global.asax to override the culture for the session in en-US. Code below
protected void Session_Start(object sender, EventArgs e) { if (Globals.CountryID == 8) { Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US"); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US"); } }
The country identifier is 8, and the culture is set to en-US in the following code. However, when I go to the page with ToString ("C") installed, it is still displayed in pounds sterling, and the culture is still within the UK.
Any suggestions?
source share