473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ASP.NET user's locale question

where do you store the information about the user's locale?

I got the answer online saying that it's System.UI.Page.Culture. But I
think it should be Thread.CurrentThread.CurrentCulture and
Thread.CurrentThread.CurrentUICulture. Could you please let me know which
answer is right?
Nov 18 '05 #1
2 2724
Thread.CurrentThread.CurrentCulture and
Thread.CurrentThread.CurrentUICulture

AS far as I know Page.Culture doesn't even exist, and even if it did you
typically want the culture set thread-wide, so that business logic will also
run in the specified culture.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Jon Wang" <jo******@hotmail.com> wrote in message
news:u0**************@TK2MSFTNGP12.phx.gbl...
where do you store the information about the user's locale?

I got the answer online saying that it's System.UI.Page.Culture. But I
think it should be Thread.CurrentThread.CurrentCulture and
Thread.CurrentThread.CurrentUICulture. Could you please let me know which answer is right?

Nov 18 '05 #2
because of asp.nets thread agility, you have to be very carefull with
setting the culture of a thread in asp.net. normally a webrequest is not
serviced by the same thread for all of the page processing calls (events).
i.e., if you set the thread culture on the pageload event, you are not
guaranteed the same culture setting will be in effect during the on a click
event for the same page request.

before calling any routines that need culture set - you should set the
culture, call the routine, then restore the culture to your default. this
will prevent the culture getting changed when you do not expect it.

-- bruce (sqlwork.com)


"Jon Wang" <jo******@hotmail.com> wrote in message
news:u0**************@TK2MSFTNGP12.phx.gbl...
where do you store the information about the user's locale?

I got the answer online saying that it's System.UI.Page.Culture. But I
think it should be Thread.CurrentThread.CurrentCulture and
Thread.CurrentThread.CurrentUICulture. Could you please let me know which answer is right?

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ksenia Marasanova | last post by:
Hi, I have some problems with locale module. On my workstation, changing locale doesn't have effect: Python 2.3 (#1, Sep 13 2003, 00:49:11) on darwin Type "help", "copyright", "credits" or...
2
by: Jorgen Grahn | last post by:
I'm sitting here with a Debian Linux 'Woody' system with the default Python 2.2 installation, and I want the re module to understand that re.compile(r'\W+'. re.LOCALE) doesn't match my national,...
4
by: Timothy Smith | last post by:
i'm trying to setlocale() on 4.10, and it appears the python package doesn't support this under 4.10. Python 2.3.3 (#2, Apr 28 2004, 22:48:37) ] on freebsd4 Type "help", "copyright", "credits"...
10
by: Timothy Smith | last post by:
hi there i need to set my locale so that when i output a number it's formatted with thousands grouped. the problem i've found is there doesn't seem to be very good cross platform support for...
1
by: Cagdas Ozgenc | last post by:
Greetings. I am confused about C++ standard library locale stuff. It seems as if the implementations of locales are not part of the library, but only some guideline classes are there. What is...
3
by: Torsten Bronger | last post by:
Hallöchen! I have to generate excerpts in different human languages in a program. In general, the language is not the locale's language, but set at runtime. Nevertheless, GNU's gettext should...
3
by: gelbeiche | last post by:
I have a question regarding the following small C program. #include <locale.h> int main() { char* loc = 0; char before,after; int i;
2
by: Daniele C. | last post by:
I will report a snippet from http://php.net/setlocale I spent about 2 seconds before thinking: can it really be? I mean, is there no way to set locale info per thread? And after a brief web...
33
by: Simon Brooke | last post by:
I'm working on a system which uses Google maps. I want the user to see a map of more or less where (s)he is in the world when (s)he first comes to the system. So the obvious thing seemed to be to...
6
by: Ole Nielsby | last post by:
Does C++ have a method of retrieving this? When launching my app, I want to select the appropriate language for ts GUI, based on the user's language setting. The frameworks wxWidgets and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.