Dynamic modules events

The dynamic modules that you created through the module builder also expose events you can subscribe to. This article provides a list of all those events and the data they pass in your event handler arguments.

IDynamicContentEvent

This interface is implemented by all events which fire for dynamic modules. Use it if you want to subscribe to all of them. Use the following code to subscribe.

In the event handler, you can access the ID of the currently logged in user.

IDynamicContentCreatingEvent

This interface is implemented by all events which fire before a dynamic content item is created. There's only one such built-in event, but you should subscribe using the interface rather than the class that implements it. Subscribe using the following code.

In the event handler you can access the following information:

  • The ID of the currently logged in user
  • The actual dynamic content item that is going to be created

IDynamicContentCreatedEvent

This interface is implemented by all events which fire after a dynamic content item has been created. There's only one such built-in event, but you should subscribe using the interface rather than the class that implements it. Subscribe using the following code.

In the event handler you can access the following information:

  • The ID of the currently logged in user
  • The date when the dynamic content item was created
  • The actual dynamic content item that was created
  • The Visible property of the dynamic content item.

IDynamicContentUpdatingEvent

This interface is implemented by all events which fire before a dynamic content item is updated. There's only one such built-in event, but you should subscribe using the interface rather than the class that implements it. Subscribe using the following code.

In the event handler you can access the following information:

  • The ID of the currently logged in user
  • The actual dynamic content item that is going to be updated

IDynamicContentUpdatedEvent

This interface is implemented by all events which fire after a dynamic content item has been updated. There's only one such built-in event, but you should subscribe using the interface rather than the class that implements it. Subscribe using the following code.

In the event handler you can access the following information:

  • The ID of the currently logged in user
  • The date when the dynamic content item was updated
  • The actual dynamic content item that was updated
  • The Visible property of the dynamic content item.

IDynamicContentDeletingEvent

This interface is implemented by all events which fire before a dynamic content item is deleted. There's only one such built-in event, but you should subscribe using the interface rather than the class that implements it. Subscribe using the following code.

In the event handler you can access the following information.

  • The ID of the currently logged in user
  • The actual dynamic content item that is going to be deleted

IDynamicContentDeletedEvent

This interface is implemented by all events which fire after a dynamic content item has been deleted. There's only one such built-in event, but you should subscribe using the interface rather than the class that implements it. Subscribe using the following code.

In the event handler you can access the following information:

  • The ID of the currently logged in user
  • The date when the dynamic content item was deleted
  • The ID of the dynamic content item that was deleted

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?