Culture settings of an application.

A

Ashish

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
 
B

bruce barker

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)
 
A

Ashish

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top