I'm trying to get my clients' country, so I use CultureInfo.CurrentCulture. Problem is that when my Canadian customers use my website, they're showing up as American.
It looks like CultureInfo.CurrentCulture is returning my server's country instead of their country. So how do I get my clients' country?
You just need to set the culture
attribute to auto
in your web.config file:
<system.web>
<globalization culture="auto" />
<system.web>
This will automatically set the CurrentCulture
to the client's culture.
You can also set uiCulture
to auto
if you're using localized resources.