Last post Jan 08, 2008 12:06 PM by JRumerman
Jan 07, 2008 11:04 PM|JRumerman|LINK
I was wondering if anybody knew where an ASP.NET thread's culture was initially set. Where is Accept-Language: en-US translated to the Culture Info assigned to the running thread?
At first I thought it was going to be somewhere in the Page class, but that is obviously too limiting (what about web services?). I followed the little white rabbit into WebHeaderCollection and UnsafeNclNativeMethods, but I've lost sight of the rabbit.
Anybody already figured this one out?
Jan 08, 2008 02:34 AM|vivek_iit|LINK
If the page culture is set to auto, then the Initilaizeculture() method fires and sets the culture as per the browser setting. Else we can also overload this method and set culture accordingly. Yo may want to look at this post:
Hope this helps,
Jan 08, 2008 12:06 PM|JRumerman|LINK
Hi Vivek (and everyone else),
That is what I initially guessed, but that's not the case. Here's the reflected code from the InitializeCulture method on the Page object:
protected virtual void InitializeCulture()
It seems that the InitializeCulture method is where we can override the culture, but it's not where it's initially set. I'm looking for the location where the header value Accept-Language is read and processed automatically.
I read through the post that you pointed me at and I don't think its listed in their either.