Bill
Bill

Reputation: 2352

Get user's geographical address

Is there a way to track user's location seamlessly without needing the user to enter his/her address?

// ASP.NET

Thanks

Upvotes: 1

Views: 204

Answers (2)

tugberk
tugberk

Reputation: 58434

You can use Geolocation feature of HTML 5. Detecting the location of the client based on their IP address does not exactly gives you the exact info. A user could be using a VPN for example.

There is sample on how you can use this feature on the below post :

http://www.hanselman.com/blog/NerdDinnerBeingUpdatedToMVC3WithRazorHTML5GeoLocationEFCodeFirstJQueryMobileYepNopeAndModernizrAndAFixedMobileDeviceCapabilitiesViewEngine.aspx

Upvotes: 1

Marcelo Cantos
Marcelo Cantos

Reputation: 185852

You can use a service like GeoIP to guess their location from their IP address. Obviously, this is easily spoofed, but it's good enough for a substantial proportion of visitors.

Upvotes: 1

Related Questions