Solved

IP and Zip Code on asp/mvc app

Posted on 2013-10-25
14
590 Views
Last Modified: 2014-03-19
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
0
Comment
Question by:solution1368
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
14 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39602137
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.
0
 

Author Comment

by:solution1368
ID: 39602152
That is ok. I still want it.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39602246
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.
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

Author Comment

by:solution1368
ID: 39602973
Thank You. But I hope to find something for free....
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39602995
Look harder at that page.  I'm using the free version.
0
 

Author Comment

by:solution1368
ID: 39603116
no idea how to get it.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39603118
On this page http://dev.maxmind.com/geoip/geoip2/geolite2/ are links for the free databases and the APIs including one for C#.
0
 

Author Comment

by:solution1368
ID: 39603408
Thank. But I don't really want to install any databases. Any API i can use without the database installed?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39603426
All you have to do is upload it.  It is a stand-alone file, not something that goes in an SQL server.  I doubt that there is anything simpler since there is a lot of information to look thru.  The API code reads the info from that database file.
0
 

Author Comment

by:solution1368
ID: 39613176
I don't want to upload those files. A simple service call will be preferable. Thanks
0
 

Author Closing Comment

by:solution1368
ID: 39634639
I finally use your idea. It works.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39634753
Glad to help.
0
 

Author Comment

by:solution1368
ID: 39634906
0
 

Expert Comment

by:brianregal
ID: 39940549
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
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question