solution1368
asked on
IP and Zip Code on asp/mvc app
Two helps from experts.
1. Assume I have a website, and I want to capture the IP from the user.
2. Once the IP is obtained, I want to convert to zip code.
I need some helps how to get both working on MVC 3 asp app.
Thanks
1. Assume I have a website, and I want to capture the IP from the user.
2. Once the IP is obtained, I want to convert to zip code.
I need some helps how to get both working on MVC 3 asp app.
Thanks
You can get the IP address from the SERVER variables. But an IP address belongs to the ISP, not the individual. Even if you can convert it, the zip code will be that of the ISP, not the individual.
ASKER
That is ok. I still want it.
For the IP address, you get it from the server variables. Look for 'remote_address' on this page: http://www.w3schools.com/asp/coll_servervariables.asp
I use MaxMind's free GeoIP services. http://www.maxmind.com/en/geolocation_landing I use the PHP version but there is an ASP.NET version on their site also.
I use MaxMind's free GeoIP services. http://www.maxmind.com/en/geolocation_landing I use the PHP version but there is an ASP.NET version on their site also.
ASKER
Thank You. But I hope to find something for free....
Look harder at that page. I'm using the free version.
ASKER
no idea how to get it.
On this page http://dev.maxmind.com/geoip/geoip2/geolite2/ are links for the free databases and the APIs including one for C#.
ASKER
Thank. But I don't really want to install any databases. Any API i can use without the database installed?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I don't want to upload those files. A simple service call will be preferable. Thanks
ASKER
I finally use your idea. It works.
Glad to help.
ASKER
more questions if you have time.
https://www.experts-exchange.com/questions/28289502/mvc-asp-net-c-razor.html
https://www.experts-exchange.com/questions/28289502/mvc-asp-net-c-razor.html
If you are looking for a service I have checked out Location Data. I think they will meet your needs. I think they are at locationdata.com