473,511 Members | 15,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Culture settings of an application.

I have a application in which culture settings are customizable, they
dont depend on the machine settings on which the application is running,
I need to make sure that all the threads running in the application
have the correct culture settings ..
I have some questions to better understand this concept ..

1. Is every thread in asp.net application associated with a session ?

2. I have a webpage which is parent of all the pages in the application,
on page_load event of this web page i make sure that the session's lcid
is set correctly...
the issue started happening when we started using out of process state
management, now i see that one of the class's constructor ( the
serialization constructor ) is being invoked from no where, and on this
thread the culture info is of the machine...

3. what would be a good place ( event) to insure that culture info of
all the threads is set correctly

any in site, thoughts would be appreciated..
TIA
-ashish
Nov 18 '05 #1
3 2155
asp.net page requests are thread agile. when a request is processed a thread
is picked from the pool, then returned as soon as possible. the agile part
is because the same thread is not always used for the whole request. that
is, the thread that handles OnLoad is not necessarily the same thread that
handles OnRender.

if you need to change a thread attribute, then you should always set before
the call that requires it, then restore it, after, otherwise you will end up
with unpredictable results.

-- bruce (sqlwork.com)

"Ashish" <as*****@mailmenot.com> wrote in message
news:uy**************@TK2MSFTNGP11.phx.gbl...
I have a application in which culture settings are customizable, they
dont depend on the machine settings on which the application is running,
I need to make sure that all the threads running in the application
have the correct culture settings ..
I have some questions to better understand this concept ..

1. Is every thread in asp.net application associated with a session ?

2. I have a webpage which is parent of all the pages in the application,
on page_load event of this web page i make sure that the session's lcid
is set correctly...
the issue started happening when we started using out of process state
management, now i see that one of the class's constructor ( the
serialization constructor ) is being invoked from no where, and on this
thread the culture info is of the machine...

3. what would be a good place ( event) to insure that culture info of
all the threads is set correctly

any in site, thoughts would be appreciated..
TIA
-ashish

Nov 18 '05 #2
hi Bruce,

thanks for the insight, now would that mean that all the constructors
in all the assemblies should check for thread's culture info ?

my specific problem is that a serialization constructor is called ( in a
satellite assembly) and the thread's culture info is not set correct so
following statement

Dim mdec As Decimal
mdec = CDec("09,98")
would result in = 9.98D if thread culture is 1043 ( dutch, netherland )
and 998.00D if the culture is 1033

isn't there a way to set globally for all the threads in the thread pool ..

thanks again
-ashish
bruce barker wrote:
asp.net page requests are thread agile. when a request is processed a thread
is picked from the pool, then returned as soon as possible. the agile part
is because the same thread is not always used for the whole request. that
is, the thread that handles OnLoad is not necessarily the same thread that
handles OnRender.

if you need to change a thread attribute, then you should always set before
the call that requires it, then restore it, after, otherwise you will end up
with unpredictable results.

-- bruce (sqlwork.com)

"Ashish" <as*****@mailmenot.com> wrote in message
news:uy**************@TK2MSFTNGP11.phx.gbl...
I have a application in which culture settings are customizable, they
dont depend on the machine settings on which the application is running,
I need to make sure that all the threads running in the application
have the correct culture settings ..
I have some questions to better understand this concept ..

1. Is every thread in asp.net application associated with a session ?

2. I have a webpage which is parent of all the pages in the application,
on page_load event of this web page i make sure that the session's lcid
is set correctly...
the issue started happening when we started using out of process state
management, now i see that one of the class's constructor ( the
serialization constructor ) is being invoked from no where, and on this
thread the culture info is of the machine...

3. what would be a good place ( event) to insure that culture info of
all the threads is set correctly

any in site, thoughts would be appreciated..
TIA
-ashish



Nov 18 '05 #3
A user's thread is formed in Global.asax's Application_BeginRequest. If you
know enough about the user at this time, you can set the thread's culture in
this method.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Ashish" <as*****@mailmenot.com> wrote in message
news:uy**************@TK2MSFTNGP11.phx.gbl...
I have a application in which culture settings are customizable, they
dont depend on the machine settings on which the application is running,
I need to make sure that all the threads running in the application
have the correct culture settings ..
I have some questions to better understand this concept ..

1. Is every thread in asp.net application associated with a session ?

2. I have a webpage which is parent of all the pages in the application,
on page_load event of this web page i make sure that the session's lcid
is set correctly...
the issue started happening when we started using out of process state
management, now i see that one of the class's constructor ( the
serialization constructor ) is being invoked from no where, and on this
thread the culture info is of the machine...

3. what would be a good place ( event) to insure that culture info of
all the threads is set correctly

any in site, thoughts would be appreciated..
TIA
-ashish

Nov 18 '05 #4

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

Similar topics

1
2310
by: JimHurst | last post by:
I'm writing a C# win forms application and the customers wish to be able to define at run/install time which language that application runs in. I've manage to set the applications culture, setting...
2
5042
by: Aliasgar Pocketwala | last post by:
Hi, I have an asp.net application that is using the wrong culture. I cant figure out where does it get its setting from. My web application runs as a specific user since so that I can give it...
0
1034
by: Ashish | last post by:
we recently introduced session state management with state server in our application, but its seems to be having some thread culture problems ... the issue is that the culture of the thread in...
4
4211
by: David Mc | last post by:
We recently installed the 1.1 redist of .Net on a new server. Only after installing .Net did I realize that the regional settings of the server had not been localized. The application we have...
1
1817
by: Ya Ya | last post by:
I am developing a DLL (class library) for a web application of mine. In the web.config of the web application I have set: culture="en-GB" uiCulture="en" in order that the date format will be...
2
1906
by: Lars Netzel | last post by:
Somone told me that you should always take care of Culture settings in the application by setting a Culture ISO thing on some Thread that ASP is runing on.. so that decimals and thousand separators...
0
1076
by: steven.cage | last post by:
I have a VB6 program which only runs successfully when run from a user account with UK regional settings. We will soon be forced to run this program from a service account with Swiss French...
9
3901
by: Edge | last post by:
hi, I am saving the user selected culture in a session variable so I can apply it back to all pages when refreshed and then load the proper .resx values. For that I am using global.asax
4
29838
by: adi | last post by:
Hi I'm using .NET Framework 1.1 My application needs to read the system's language settings. How to do this? Thanks.
0
7153
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
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.