You need an IP-address-based reverse geocoding API… like the one from ipdata.co. I’m sure there are plenty of options available.
You may want to allow the user to override this, however. For example, they could be on a corporate VPN which makes the IP address look like it’s in a different country.
More Related Contents:
- How do you create a dropdownlist from an enum in ASP.NET MVC?
- How do you set the Content-Type header for an HttpClient request?
- How to increase the max upload file size in ASP.NET?
- Member ” cannot be accessed with an instance reference
- How do I create a Dto in C# Asp.Net from a fairly complex Json Response
- ASP.NET Calling WebMethod with jQuery AJAX “401 (Unauthorized)”
- How to get a property value based on the name
- How do I decode a URL parameter using C#?
- The CodeDom provider type “Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider” could not be located
- Forms Authentication across Sub-Domains
- parameterized queries vs. SQL injection
- How do I loop through a date range?
- Visual Studio – Resx File default ‘internal’ to ‘public’
- ASP.NET MVC – How to show unauthorized error on login page?
- How to get current user who’s accessing an ASP.NET application?
- Get url without querystring
- How to set web.config file to show full error message
- GridView bound with Properties of nested class
- .NET Configuration (app.config/web.config/settings.settings)
- “Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions” error
- I’m getting the “missing a using directive or assembly reference” and no clue what’s going wrong
- MvcSiteMap generating a Menu without messing the breadcumbs
- Parsing a JSON array using Json.Net
- ASP.net Getting the error “Access to the path is denied.” while trying to upload files to my Windows Server 2008 R2 Web server
- ASP.NET Custom 404 Returning 200 OK Instead of 404 Not Found
- Font awesome inside asp button
- Error handling (Sending ex.Message to the client)
- Post Publish Events
- Count total rows of gridview with pagination
- An error occurred attempting to determine the process id of dotnet.exe which is hosting your application. One or more error occured