This is more specific and cleaner version of this question - Different DateTimeFormat for dev and test environment
In the Application_BeginRequest() method of global.asax.cs in my ASP.NET MVC project there is code:
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
When I set a breakpoint on Controller Action I see the following value of Thread.CurrentThread.CurrentCulture:
Question is - What settings in IIS are responsible for this and how can I override it?
ASP.NET is a web platform. It provides a layer that sits on top of IIS (the web server) which facilitates the creation of web applications and web services. ASP.NET MVC is a framework specifically for building web applications. It sits ontop of ASP.NET and uses APIs provided by ASP.NET.
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications.
Rather than setting the Thread's culture, you can specify it in the web.config like so:
<configuration> <system.web> <globalization uiCulture="en-GB" culture="en-GB" /> </system.web> </configuration>
That is a more "proper" way of specifying the culture in ASP.NET.
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