Obtain current culture ???

C

cmrchs

Hi,

I try to obtain the current culture of a server by executing :

string str = Thread.CurrentThread.CurrentCulture.ToString();

Executing this in a console-applicastion results in the correct string (e.g. "en-AU")
but when executing in ASP.NET does the command always return "en-US" ???

How come ?
How can I make sure it does return the correct cultureInfo ?

thanks
Chris


**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
J

Jc Morin

Hi Chris,

Current culture on server-side are always set to default culture (english
us). The value is also reset from request to request.
In global.asax you can assign the CurrentCulture thread with some mechanism
(involving client-side cookies or as Jerome said
Thread.CurrentThread.CurrentUICulture)

--------------------------
Jean-Claude Morin, MCP
Software Developer
2k1Soft/kCentric, Canada


Chris C said:
Hi,

I try to obtain the current culture of a server by executing :

string str = Thread.CurrentThread.CurrentCulture.ToString();

Executing this in a console-applicastion results in the correct string (e.g. "en-AU")
but when executing in ASP.NET does the command always return "en-US" ???

How come ?
How can I make sure it does return the correct cultureInfo ?

thanks
Chris


**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
 
S

Scott Allen

There is also the uiCulture attribute of the <globalization> element
in web.config, if you want to set the culture for the appDomain.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top