4

Where does Thread.CurrentCulture gets it's data from? Client (browser) or server.

And another question, is this the right way to find out the culture of the user?

Thanks

skaffman
  • 398,947
  • 96
  • 818
  • 769
iBiryukov
  • 1,730
  • 4
  • 19
  • 30

2 Answers2

3

Thread.CurrentCulture gets the info for the executing thread. ASP.NET code is running on the server; hence, this will give you the current culture of the server thread.

To find the client accepted languages, use HttpRequest.UserLanguages instead.

Franci Penov
  • 74,861
  • 18
  • 132
  • 169
0

I assume you mean in an ASP.NET environment? Normally the server culture is returned.

Maybe you can use this article on Auto-Culture Handling in ASP.NET (depending on browser languages): http://msdn.microsoft.com/en-us/magazine/cc163849.aspx

Koen
  • 3,626
  • 1
  • 34
  • 55