I have a client in the US that wants all time displayed as military time, but everything else is supposed to be US Culture.
In my global.asax I am creating a copy of the US culture and applying the GB time display to create a US culture with Military time.
Reason I am doing this is I could not find a culture capable of it, however if anyone knows, that would be great.
The problem I am running into, is when we deploy the website to IIS (version 6), it all reverts back seemingly to US culture.
Looking up how to change the culture, I found the setting in ASP.NET Tab -> Edit Configuration -> Application Tab
Default value is af-ZA.
There seems to be no option to disable this overriding of culture, and I don't believe af-ZA is right anyways?
Is there a way to prevent IIS from overriding a culture programmatically set in ASP.NET?
Note: Asking here since I'm looking for server side solution, not programming one. Thanks!
This is at least partially a coding question. Basically, you need to create and register your new culture using the CultureAndRegionInfoBuilder class from System.Globalization.
Once registered, you can then choose your new culture within the ASP.Net application settings. (or within the web.config file for your application.)
Here are some references that should get you started:
http://msdn.microsoft.com/en-us/library/ms172469.aspx
http://msdn.microsoft.com/en-us/library/system.globalization.cultureandregioninfobuilder.aspx
Found the answer to my question after talking to someone more versed in servers and asp.net
Apparently you can -only- set application wide cultures in the Web.config
I was setting it in the application's main thread in global.asax which did not carry over to child threads processing page requests.
Interesting thing is, when running on local machine through Visual Studio's hosting process, all request must be done through the same thread.
This is what lead me to believe it was an issue with IIS, since not until we put it on IIS did the issue appear.
My solution: (Accepted a more proper solution)
A custom culture must be set on each page request thread. My solution was to put it into the Master page load. IIS does not override your settings.