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 unauthenticated 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.

IForbiddenPageAccessEvent

This interface is implemented by events fired when an authenticated user tries to access a restricted page. If the user is unauthenticated, the IUnauthorizedPageAccessEvent is fired instead.

NOTE: This interface is available in Sitefinity CMS version 13.1.7425 and later.

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.

 

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

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?

Next article

Profile events