Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This answer can be combined with GeekyMonkey's answer.</p> <p>First of all, in ASP.NET you have the possibility to set the culture and UI culture in web.config using the <a href="http://msdn.microsoft.com/en-us/library/hy4kkhe0.aspx" rel="nofollow noreferrer"><code>globalization</code></a> element. The <code>resourceProviderFactoryType</code> attribute is your friend when you have special formatting needs.</p> <p>Another possibility is to create a subclass of the ASP.NET Page class and override the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.page.initializeculture.aspx" rel="nofollow noreferrer"><code>InitializeCulture</code></a> method. Here you can change the culture and UI culture which is stored in the current thread handling the HTTP request.</p> <p>A quick example:</p> <pre><code>protected override void InitializeCulture() { Thread.CurrentThread.CurrentCulture = ...; Thread.CurrentThread.CurrentUICulture = ...; Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = "dd-MM-yyyy"; ... } </code></pre> <p>For those worried about ASP.NET doing "random" thread switching:</p> <blockquote> <p>ASP.NET ensures that, even if they switch your thread, the CurrentPrincipal and culture properties from the original thread carry forward to the new thread. This is automatic, and you don’t need to worry about losing those values. Whew!</p> <p>Source: <a href="http://www.lhotka.net/WeBlog/PermaLink,guid,019e3c37-38ed-492e-b769-16e1a57fed0a.aspx" rel="nofollow noreferrer">ASP.NET thread switching</a></p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload