IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
IpCityLocationService
IIpCityLocationService
ObjectFactory
GetLocation(IPAddress ipAddress)
bool IsReady
To extend the default functionality, you can call the Sitefinity base implementation and plug your logic afterwards. For example:
Next, you register the newly created service in Global.asax as follows:
Sitefinity implementation of IpCityLocationService relies on the MaxMind GeoLite2 database. To change this logic completely and use a different GeoLocation database, you can implement the IIpCityLocationService interface with your own logic and register the service.
The following example demonstrates how to implement the IIpCityLocationService with the previous version of the MaxMind GeoLite City database and API.
NOTE: The database and API versions of MaxMind GeoLite, mentioned above are used by Sitefinity CMS versions 11.0 and older. In case you notice discrepancies in the behavior between the old database and the new one used in Sitefinity 11.1 and newer, you can use this sample to achieve backward compatibility. In addition, you can use this sample to get you started on how IIpCityLocationService interface can be implemented for any other geo IP database service and used in Sitefinity.
IsReady
LookupService
getLocation(IPAddress addr)
CityLocation
The complete sample follows:
Bootstrapper.Bootstrapped
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important