views:

38

answers:

1

How can I get a user's geolocation information (City and Country - internet service provider and internet speed would also be great) based on their IP address?

I've searched and found several tools for doing this but I seem to run into problems using them with asp.net mvc. Many of them relate to using json and the "security risk" involved in cross domain ajax calls. Any ideas to overcome this problem?

A: 

Any of them use JSONP? With JSONP you can grab data from other domains. It would help if you tell us which tools you want to use.

Ralph Stevens
WIP mania uses jsonp, and this works great with mvc. http://www.wipmania.com/en/blog/geolocation-api-json-jsonp/ They do not provide any City or ISP information however. http://ipinfodb.com/index.php looks better, but does not offer jsonp.
Victor
The second one can be used with ASP.NET MVC. Just use their XML API. I just looked at it. You just request a URL and it sends you the XML formatted data.
Ralph Stevens
Ralph, Can you give me a link with an example of how to do this? I'm trying to retrieve the data with jquery and I'm still getting security issues with this being a cross-domain request.
Victor
Your json call would be to your server (the Controller would return JsonResult). The server would make the URL request to the site, parse the result and send it to the browser.
Ralph Stevens