We have a range of Classic ASP applications that we are looking to port to the new Windows Azure Website hosting.
The Classic ASP websites are written against a server that was running in UK locale. The classic ASP has been coded to use UK datetime formats in various ways in hundreds of pages. When I have previously tried the code on servers with US locale the datetime handling fails as the datetime format is different.
Does anyone know if I can specifiy the locale for the website?
Alternatively does anyone know how to change the locale on a standard web role with a start-up task?
If you want to configure the website globalization, it is best to perform using globalization element.
To change locale of your website you can set the culture and uiculture properly in web.config.
In Windows Azure if you want to do it in startup task you would need to create a batch file (i.e. global.cmd) in which can run the following command:
Appcmd set config /commit:WEBROOT /section:globalization /culture: string
Appcmd set config /commit:WEBROOT /section:globalization /uiCulture: string
Above change the "string" to your desired locale code.
Finally you can create startup task as defined in the ServiceDefinition.csdef
<Startup>
<Task commandLine="global.cmd" executionContext="elevated" taskType="simple" />
</Startup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With