IDataEvent

The IDataEvent represents a contract for event notification containing minimal information about modified items. As you want to have a global event for all content, you can subscribe to the IDataEvent - it will be thrown on the Create, Update, and Delete actions for all content. Inside the event handler you can get information about the:

  • Event Action
    • New (corresponds to Create action)
    • Updated
    • Deleted
  • ItemType
  • ItemId
  • ProviderName

This data is sufficient to allow you to load the corresponding manager and retrieve the actual item.

To subscribe to the IDataEvent:

  1. In Visual Studio, in your project, open the Global.asax file.

    NOTE: If you do not have a Global.asax file, create a new Global.asax file and add it to your project. In the context menu of your project, click Add » New Item… » Visual C# » Web » Global Application Class..

  2. Add the following code:

As a result you are subscribed to the IDataEvent and you can access the event's ID, provider name, action, item type. and so forth. You can modify the event's attributes, subscribe an email address to the event, and so on.

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

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

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.

Web Security for Sitefinity Administrators

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.

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?