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
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important