473,670 Members | 2,656 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 2166
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*****@mailme not.com> wrote in message
news:uy******** ******@TK2MSFTN GP11.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*****@mailme not.com> wrote in message
news:uy******** ******@TK2MSFTN GP11.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
serializati on 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_Beg inRequest. 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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Ashish" <as*****@mailme not.com> wrote in message
news:uy******** ******@TK2MSFTN GP11.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
2316
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 the Thread.CurrentThread.CurrentUICulture and Thread.CurrentThread.CurrentCulture to a new CultureInfo class. This works fine for the application resources, windows, string tables, etc, however the system dialogs, print, print preview, color...
2
5055
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 some more rights. I can login to the web server using this user identity. Now I go to the regional settings and change the date format to a specific (dd-MMM-yyyy) format. Now my asp.net process is running properly with this new identity however...
0
1041
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 constructor of a class, which implements Serialization, is different from the culture of the thread at Application_begin request ... i check the culture of the current thread at both the places and its different, one thing to notice is that the...
4
4220
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 written uses GB style dates i.e. dd/mm/yyyy. When running new server we were getting error message - i.e. incorrect date format. First we removed the app and .net, reset the locale, rebooted and re-installed everything. However server still...
1
1826
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 dd/mm/yyyy. I also changed the regional settings to that date format. When I am using the Now() function in the DLL I get the date format in mm/dd/yyyy instead. Why the date format in the DLL is different? Shouldn't it take the culture settings...
2
1915
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 and stuff won't be chaos in for different countries. How do I set these things and can someone explain more? /Lars
0
1085
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 regional settings and we do not have time at the moment to port this application to .net. One possible solution we thought of was to create a c# program in which we change the culture to en-GB and then call the VB6 program. Unfortunately, when we call...
9
3915
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
29847
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
8468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8591
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6213
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4209
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.