Each user of my application will choose their country, after which it will be stored in a cookie and stored for later requests. Everything is working OK, but I need to set the culture at the start of a session. I'm currently experimenting by setting the culture in the web.config to be en-GB and then using the Global.asax to override the culture for the session to 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 countryID is 8, and the culture is set to en-US in the following code. However, when I navigate to a page that has ToString("C") set, it still displays in GBP and the culture is still en-GB.
Any suggestions?