Pages events

The following articles describes the events exposed by pages in Sitefinity.

IUnauthorizedPageAccessEvent

This interface is implemented by all events which fire when a page in the site is accessed by an unauthorized user. There's only one such built-in event, but you should always subscribe using the interface rather than the class that implements it. Use the following code to subscribe.

In the event handler, you can access the following information:

  • The HTTP Context for the page which was accessed.
  • The PageSiteNode object for the page itself.
  • The redirect strategy used.
  • The URL to which the user was redirected.

IPagePreRenderCompleteEvent

An interface of the event notifying that a page's PreRender event has completed.
The event is raised at 'PreRenderComplete' event of ASP.NET page lifecycle. A subscription for this event can be created by using the EventHub. Use the following code to subscribe:

In the event handler, you can access the following information:

  • The PageSiteNode object for the page itself
  • The Page itself

Personalized pages events

IPersonalizedWidgetRenderEvent 

If the visitors browsing the page are associated with certain audience segments and in case the page has personalized versions of widgets created for these specific segments, the IPersonalizedWidgetRenderEvent is fired. The event is fired for each personalized widget.

Since there is just one such built-in event, you always subscribe using the interface rather than the class that implements it. Use the following code to subscribe:

In the event handler, you can access the following information:

  • Segment name
  • Widget ID
  • Page URL
  • Origin from where the event is fired

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

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.

Was this article helpful?