Reputation: 29749
How can I determine if user is Canadian based on web browser settings?
I'm using Asp.net 2.0.
Upvotes: 0
Views: 169
Reputation: 6724
Determining if "user is Canadian," is a pretty ambiguous statement. You can determine if a user's browser culture is set to something Canadian by inspecting HttpRequest.UserLanguages
. Canadian English is en-CA
, Canadian French is fr-CA
.
If you're trying to determine if a user is actually sitting in Canada, the best you could hope for is to attempt to resolve location based on their IP, but this isn't going to be reliable. Here's a publically available serivce for doing that.
Upvotes: 2