CultureInfo and Web.Config

  • Thread starter Thread starter RicercatoreSbadato
  • Start date Start date
R

RicercatoreSbadato

I'd like to change the "CultureInfo" of my site.
Which instruction I have to put in the 'web.config' ?
any ideas?
tnx ;)
 
Hi,
I'd like to change the "CultureInfo" of my site.
Which instruction I have to put in the 'web.config' ?
any ideas?
tnx ;)

In web.config:

<globalization
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
culture="en-GB"
uiCulture="en-GB"
/>

In code-behind:

System.Threading.Thread.CurrentThread.CurrentCulture
= new System.Globalization.CultureInfo( "en-GB" );
System.Threading.Thread.CurrentThread.CurrentUICulture
= new System.Globalization.CultureInfo( "en-GB" );

Note: This affects the culture of the current thread only. Since each
request runs in a different thread, you must set it for each request
separately (i.e. in the Page's OnInit for example).

HTH,
Laurent
 
I odn't understand. I've to modify both the web.config and the code
behind? I'd like to modify only the web.config.. is it right ?
 
Hi,
He offered you a *choice*.
You can do one or the other...or both if you need to.

You can modify it in web.config *and* you can modify it it code.
Your choice...or both if you need to.

That's correct, and sorry that I wasn't clear.

Laurent
 
Back
Top