Is this really the version you are looking for? Kentico 9 documentation is no longer updated. Use the switch in the header to choose your Kentico version.

Reference - Global system events

Event categories (classes):

ObjectEvents

Namespace: CMS.DataEngine

Contains events that occur for all types of objects in the system. See also: Handling object events

Important

Use the following classes to access the object events in the API:

  • ObjectEvents - events triggered for all object types
  • <name>Info.TYPEINFO.Events - events triggered only for a specific object type, for example: UserInfo.TYPEINFO.Events

Event

Event types

Handler parameters

Description

Insert
_______________________

Before
After
Failure

ObjectEventArgs

 Properties
  • Object (BaseInfo)

Occurs when a new object is created.

Update

Before
After
Failure

ObjectEventArgs

 Properties
  • Object (BaseInfo)

Occurs when the data of an existing object is updated.

To reliably handle all possible object update events, you may also need to assign a matching handler to the BulkUpdate event. The system triggers the BulkUpdate event instead of Update in certain cases, particularly for operations that can affect multiple objects.

BulkUpdate

Before
After
Failure

BulkUpdateEventArgs

 Properties
  • ChangedColumns (IEnumerable<string>)
  • TypeInfo (ObjectTypeInfo)
  • WhereCondition (IWhereCondition)
    _________________________________

Occurs when the system performs object update operations that can affect multiple objects. To reliably handle all possible object update events, assign matching handlers to both the BulkUpdate and Update events.

Note: This event is not available among the events of specific object types: <name>Info.TYPEINFO.Events. To add a handler for a specific object type, assign the handler to the global ObjectEvents.BulkUpdate event, and add an object type condition into the handler code using the TypeInfo property of the BulkUpdateEventArgs parameter. For example: if (e.TypeInfo.ObjectType == UserInfo.OBJECT_TYPE)

Delete

Before
After
Failure

ObjectEventArgs

 Properties
  • Object (BaseInfo)

Occurs when an object is deleted.

GetContent

Execute
___________

ObjectEventArgs

 Properties
  • Content (string)

  • Object (BaseInfo)

Occurs before the system writes an object's data into smart search indexes (when building or updating indexes).

Allows you to determine exactly how search indexes store object content.

Example: Customizing the content of search indexes

LogChange

Before
After
Failure

LogObjectChangeEventArgs

 Properties
  • Settings (LogObjectChangeSettings)
    _______________________________

Occurs when the system logs object changes for the purposes of staging and integration. For example, allows you to exclude specific objects from staging.

Example: Excluding content from staging and integration

CheckPermissions

Before
After
Failure

ObjectSecurityEventArgs

 Properties
  • Object (BaseInfo)

  • Permission (PermissionsEnum)

  • User (UserInfo)

  • SiteName (string)

  • Result (AuthorizationResultEnum)
    ________________________________

Occurs when the system checks permissions for objects of the given type.
Sort

Before
After
Failure

ObjectSortEventArgs

 Properties
  • Object (BaseInfo)

  • Ascending (bool)

  • OrderColumn (string)

  • NameColumn (string)_
    ______________________________

Occurs when sorting of objects is requested.

Note: This event is not available among the events of specific object types: <name>Info.TYPEINFO.Events. To add a handler for a specific object type, assign the handler to the global ObjectEvents.Sort event, and add an object type condition into the handler code using the Object property of the ObjectSortEventArgs parameter. For example: if (e.Object.TypeInfo.ObjectType == UserInfo.OBJECT_TYPE)

ChangeOrderBefore
After
Failure

ObjectChangeOrderEventArgs

 Properties
  • Object (BaseInfo)

  • NewOrder (int)

  • RelativeOrder (int)

  • OrderColumn (string)
    _______________________________

 Occurs when a change in the order of objects is requested.

Note: This event is not available among the events of specific object types: <name>Info.TYPEINFO.Events. To add a handler for a specific object type, assign the handler to the global ObjectEvents.ChangeOrder event, and add an object type condition into the handler code using the Object property of the ObjectChangeOrderEventArgs parameter. For example: if (e.Object.TypeInfo.ObjectType == UserInfo.OBJECT_TYPE)

GetData

Before
After
Failure

ObjectDataEventArgs

 Properties
  • Data (DataSet)
  • Query (IObjectQuery)
  • TotalRecords (int)

Occurs when the system retrieves object data using the ObjectQuery API.

The Before event type is suitable, for example, when you want to retrieve data from an external source. Assign the external data into the Data property of the handler's ObjectDataEventArgs parameter, which is empty by default in the Before event.

Use the After event type if you need to edit the data retrieved from Kentico in the Data property.

The TotalRecords property provides a number of total records in case paging is used. Use -1 to use the rows count of the Data property.

> Back to list of event categories

DocumentEvents

Namespace: CMS.DocumentEngine

Contains events fired when changes are made to pages.

Note:

Pages under workflow require a different approach to event handling. Use the events from the WorkflowEvents class instead of DocumentEvents.

For example, to handle the 'update' action for a page under workflow, use the SaveVersion event from WorkflowEvents instead of the DocumentEvents.Update event.

Event

Event types

Handler parameters

Description

Insert
_______________________

Before
After
Failure

DocumentEventArgs

 Properties
  • TargetParentNodeID (int)

  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a new page is created.

InsertNewCulture

Before
After
Failure

DocumentEventArgs

 Properties
  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a new culture version is created for a page.

InsertLink

Before
After
Failure

DocumentEventArgs

 Properties
  • TargetParentNodeID (int)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when creating new linked pages.

Update

Before
After
Failure

DocumentEventArgs

 Properties
  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when an existing page is updated.

Move

Before
After
Failure

DocumentEventArgs

 Properties
  • TargetParentNodeID (int)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a page is moved to a different position in the site's content tree.

Copy

Before
After
Failure

DocumentEventArgs

 Properties
  • TargetParentNodeID (int)
  • IncludeChildren (bool)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a new copy of a page is created.

Delete

Before
After
Failure

DocumentEventArgs

 Properties
  • Node (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a page is deleted.

GetContent

Execute
___________

DocumentSearchEventArgs

 Properties
  • Content (string)
  • Node (TreeNode)

  • Settings (SearchIndexSettingsInfo)
  • IndexInfo (ISearchIndexInfo)
  • SearchDocument (ISearchDocument)
  • IsCrawler (bool)

Occurs before the system writes a page's data into a Smart search index (when building or updating indexes).

Allows you to determine exactly how search indexes store page content.

Examples: Customizing the content of search indexes

LogChange

Before
After
Failure

LogDocumentChangeEventArgs

 Properties
  • Settings (LogDocumentChangeSettings)
    __________________________________

Occurs when the system logs page changes for the purposes of staging and integration. For example, allows you to exclude specific pages from staging.

Example: Excluding content from staging and integration

CheckPermissions

Before
After
Failure

DocumentSecurityEventArgs

 Properties
  • Node (TreeNode)

  • Permission (PermissionsEnum)

  • User (UserInfo)

  • SiteName (string)

  • Result (AuthorizationResultEnum)
    _____________________________

Occurs when the system checks permissions for pages.

Note: This event does not occur on the live site. For checking permissions on the live site, see the AuthorizeDocument event.

SortBefore
After
Failure

DocumentSortEventArgs

 Properties
  • ParentNodeId (int)

  • Ascending (bool)
  • SortType (DocumentSortEnum) ________A_________________
Occurs when sorting of pages is requested.
ChangeOrderBefore
After
Failure

DocumentChangeOrderEventArgs

 Properties
  • Node (TreeNode)

  • OrderType (DocumentOrderEnum)_________________________

 Properties
  • Node (TreeNode)

  • NewOrder (int)

  • RelativeOrder (bool)____________________________

Occurs when a change in the order of pages is requested.
GetDataBefore
After
Failure

DocumentDataEventArgs

 Properties
  • Data (DataSet)
  • Query (IDocumentQuery)
  • TotalRecords (int)

Occurs when the system retrieves page data using the DocumentQuery API.

The Before event type is suitable, for example, when you want to retrieve data from an external source. Assign the external data into the Data property of the handler's DocumentDataEventArgs parameter, which is empty by default in the Before event.

Use the After event type, when you want to edit the data retrieved from Kentico in the Data property.

The TotalRecords property provides a number of total records in case paging is used. Use -1 to use rows count of the Data property.

Page attachments

SaveAttachment

Before
After
Failure

DocumentEventArgs

 Properties
  • Attachment (AttachmentInfo)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)
    __________________________

Occurs when a file attachment is added to a page or updated.

DeleteAttachment

Before
After
Failure

DocumentEventArgs

 Properties
  • Attachment (AttachmentInfo)
  • Node (TreeNode)

  • TreeProvider (TreeProvider)
    __________________________

Occurs when a file attachment is removed from a page.

Page security

AuthorizeDocument

Execute

DocumentAuthorizationEventArgs

 Properties
  • User (UserInfo)

  • Data (DataSet)

  • Document (TreeNode)

  • PermissionName (string)

  • AuthorizationResult (AuthorizationResultEnum)
    _______________________________________

Occurs when the system performs a security check for the permissions of a specific page.

FilterDataSetByPermissions

Execute

DocumentAuthorizationEventArgs

 Properties
  • User (UserInfo)

  • Data (DataSet)

  • Document (TreeNode)

  • PermissionName (string)

  • AuthorizationResult (AuthorizationResultEnum)
    _______________________________________

Occurs when the system filters a set of pages according to the page permissions of a user.

> Back to list of event categories

WorkflowEvents

Namespace: CMS.DocumentEngine

Contains events related to workflow and versioning actions.

Event

Event types

Handler parameters

Description

Approve
_______________________

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • PreviousStep (WorkflowStepInfo) - only in the After event

  • TreeProvider (TreeProvider)
    _________________________________________________

Occurs when a page is approved to the next step.

Reject

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • PreviousStep (WorkflowStepInfo) - only in the After event

  • TreeProvider (TreeProvider)
    _________________________________________________

Occurs when a page is rejected back to a previous step

Publish

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • PublishedDocument(TreeNode) - only in the After event

  • PreviousStep (WorkflowStepInfo) - only in the After event

  • TreeProvider (TreeProvider)
    _________________________________________________

Occurs when a page reaches the published step.

Archive

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • PreviousStep (WorkflowStepInfo) - only in the After event

  • TreeProvider (TreeProvider)
    _________________________________________________

Occurs when a page is archived.

Action

Before
After
Failure
___________

WorkflowActionEventArgs<TreeNode, BaseInfo, WorkflowActionEnum>

Requires references to:

  • CMS.WorkflowEngine
  • CMS.DataEngine

Occurs when executing advanced workflow action steps.

Page versioning
SaveVersion

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • VersionHistory (VersionHistoryInfo)

  • VersionNumber (string)
  • VersionComment (string)
  • TreeProvider (TreeProvider)

Occurs when the edited version of a page is updated.
SaveAttachmentVersion

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • Attachment (AttachmentInfo)

  • TreeProvider (TreeProvider)

Occurs when an attachment is updated or inserted for the edited version of a page.
RemoveAttachmentVersion

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • Attachment (AttachmentInfo)

  • TreeProvider (TreeProvider)

Occurs when an attachment is removed for the edited version of a page.
Content locking
CheckOut

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a page is checked-out.
CheckIn

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a page is checked-in.
UndoCheckOut

Before
After
Failure

WorkflowEventArgs

 Properties
  • Document (TreeNode)

  • TreeProvider (TreeProvider)

Occurs when a user performs the undo check-out action.

> Back to list of event categories

SecurityEvents

Namespace: CMS.Membership

Contains security and authentication events.

Event

Event types

Handler parameters

Description

Authenticate
_______________________
Execute
___________

AuthenticationEventArgs

 Properties
  • User (UserInfo)

  • UserName (string)

  • Password (string)

Occurs when authenticating users.

See also: Handling custom external authentication

AuthenticationRequestedExecute

AuthenticationRequestEventArgs

 Properties
  • RequestedUrl (string)

Occurs when a user accesses a restricted section of Kentico and the user's authentication is required.

MultiFactorAuthenticate

Execute

AuthenticationEventArgs

 Properties
  • Passcode (string)
  • UserName (string)

  • Password (string)

Occurs when a user tries to sign in to Kentico with multi-factor authentication enabled.

AuthorizeResource

Execute

AuthorizationEventArgs

 Properties
  • User (UserInfo)

  • ResourceName (string)

  • PermissionName (string)

  • Authorized (bool)

Occurs when checking the permissions for modules.

AuthorizeClass

Execute

AuthorizationEventArgs

 Properties
  • User (UserInfo)

  • ClassName (string)

  • PermissionName (string)

  • Authorized (bool)

Occurs when performing security checks for object type or page type permissions.

AuthorizeUIElementExecute

AuthorizationEventArgs

 Properties
  • User (UserInfo)

  • ElementName (string)

  • PermissionName (string)

  • Authorized (bool)

Occurs when checking permissions for UI elements.

SignOut

Before
After
Failure

SignOutEventArgs

 Properties
  • User (UserInfo)

  • SignOutUrl (string)

Occurs when a user signs out from a website.

> Back to list of event categories

StagingEvents

Namespace: CMS.Synchronization

Contains events that occur when using content staging for pages and objects.

Event

Event types

Handler parameters

Description

LogTask
_______________________

Before
After
Failure

StagingLogTaskEventArgs

 Properties
  • Object (BaseInfo)

  • Task (StagingTaskInfo)

Occurs when creating staging tasks on the source server after a page or object is changed in the system.

See also:

Synchronize

Before
After
Failure

CMSEventArgs

Occurs on the source server when synchronizing staging tasks — once per synchronize action, even when processing multiple tasks.

SynchronizeTask

Before
After
Failure

StagingTaskEventArgs

 Properties
  • Task (StagingTaskInfo)

Occurs on the source server when synchronizing staging tasks — separately for every processed task.

ProcessTask

Before
After
Failure
___________

StagingSynchronizationEventArgs

 Properties
  • TaskType (TaskTypeEnum)

  • ObjectType (string)

  • TaskData (DataSet)

  • TaskBinaryData (DataSet)

  • TaskHandled (bool)
  • SyncManager (ISyncManager)

Occurs on the target server when processing incoming staging tasks.

The processing of the staging tasks then also triggers the corresponding ObjectEvents (Insert, Update, Delete, etc.). If the CMSStagingUseTreeCustomHandlers web.config key is set to true, the DocumentEvents are triggered, too.

> Back to list of event categories

IntegrationEvents

Namespace: CMS.Synchronization

Contains events that occur when synchronizing pages or objects between Kentico and other applications using the integration bus.

See also:

Event

Event types

Handler parameters

Description

LogInternalTask
_______________________

Before
After
Failure

IntegrationTaskEventArgs

 Properties
  • Task (IntegrationTaskInfo)

  • Object (BaseInfo)

Occurs when creating outgoing integration tasks after a page or object in the system is changed.

LogExternalTask

Before
After
Failure
___________

IntegrationTaskEventArgs

 Properties
  • Task (IntegrationTaskInfo)

  • Object (BaseInfo)

Occurs when the system creates incoming tasks provided by an integration connector.

> Back to list of event categories

ImportExportEvents

Namespace: CMS.CMSImportExport

Contains events related to import and export actions.

Event

Event types

Handler parameters

Description

Import
_______________________

Before
After
Failure

ImportBaseEventArgs

 Properties
  • Settings (SiteImportSettings)

Occurs at the start of the import process.
ImportObject

Before
After
Failure

ImportEventArgs

 Properties
  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs once for every imported object.
ImportObjects

Before
After
Failure

ImportDataEventArgs

 Properties
  • Settings (SiteImportSettings)

  • Data (DataSet)

  • ObjectType (string)

  • SiteObjects (bool)

  • ParentImported (bool)

Occurs when importing sets of objects.
ImportBinding

Before
After
Failure

ImportEventArgs

 Properties
  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs once for every imported binding object.
ImportBindings

Before
After
Failure

ImportEventArgs

 Properties
  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs when importing binding objects.
ImportChild

Before
After
Failure

ImportEventArgs

 Properties
  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs once for every imported child object.
ImportChildren

Before
After
Failure

ImportEventArgs

 Properties
  • Settings (SiteImportSettings)

  • Object (BaseInfo)

  • ParentObject (BaseInfo)

  • Parameters (ImportParameters)

Occurs when importing child objects.
GetImportData

Before
After
Failure

ImportGetDataEventArgs

 Properties
  • Settings (SiteImportSettings)

  • Data (DataSet)
  • Object (BaseInfo)

  • ObjectType (string)
  • SiteObjects (bool)

  • SelectionOnly (bool)

Occurs when importing data. Allows you to work with the data set in the import package created for a specific object types.

  • Use the Before event type to modify the data in the import package (for example add data from an external source).
  • Use the After event type to modify the data after the import package has been loaded.
ProcessFileOperation

Before
After
Failure

ImportProcessFileOperationEventArgs

 Properties
  • Operation (FileOperation)

  • Settings (SiteImportSettings)

Occurs when processing file/folder operations in the import package.
ImportCanceledExecute

ImportBaseEventArgs

 Properties
  • Settings (SiteImportSettings)

Occurs when a user cancels the import process.
ImportErrorExecute
___________

ImportErrorEventArgs

 Properties
  • Exception (Exception)

  • Settings (SiteImportSettings)

Fires when an error occurs during the import process.

Event

Event types

Handler parameters

Description

Export
_______________________

Before
After
Finished
Failure

ExportEventArgs

 Properties
  • Settings (SiteExportSettings)

  • SiteObjects (bool)
    __________________________

Occurs at the start of the export process.
ExportObjects

Before
After
Failure

ExportEventArgs

 Properties
  • Settings (SiteExportSettings)

  • Data (DataSet)

  • ObjectType (string)

  • SiteObjects (bool)
    __________________________

Occurs when exporting objects.
GetExportData

Before
After
Failure

ExportGetDataEventArgs

 Properties
  • Settings (SiteExportSettings)

  • Data (DataSet)

  • ObjectType (string)

  • WhereCondition (string)

  • ChildData (bool)

  • SelectionOnly (bool)

  • Parameters(QueryDataParameters)
    ______________________________

Occurs when exporting data. Allows you to work with the data set in the export package created for specific object types.

  • Use the Before event type to extract data from the export package.
  • Use the After event type to modify the data in the export package.
SingleExportSelectionExecute

SingleExportSelectionEventArgs

 Properties
  • Settings (SiteExportSettings)

  • InfoObject (BaseInfo)

  • SelectedObject (List<string>)
    __________________________

Occurs when selecting related objects during single object export. Allows you to attach related objects to the export package.
ExportCanceledExecute

ExportBaseEventArgs

 Properties
  • Settings (SiteExportSettings)
    __________________________

Occurs when a user cancels the export process.
ExportErrorExecute
___________

ExportErrorEventArgs

 Properties
  • Exception (Exception)
  • Settings (SiteExportSettings)
    __________________________

Fires when an error occurs during the export process.

> Back to list of event categories

DocumentImportExportEvents

Namespace: CMS.DocumentEngine

Contains events related to import and export of pages.

Event

Event types

Handler parameters

Description

ExportDocuments
_______________________

Before
After
Failure

DocumentsExportEventArgs

 Properties
  • Settings (SiteExportSettings)

  • Data (DataSet)

  • ObjectType (string)

  • SiteObjects (bool)
    __________________________

Occurs when exporting pages.

ImportDocument

Before
After
Failure

DocumentImportEventArgs

 Properties
  • Document (TreeNode)
  • Settings (SiteImportSettings)

Occurs once for every imported page.
ImportDocuments

Before
After
Failure

DocumentImportEventArgs

 Properties
  • Document (TreeNode)
  • Settings (SiteImportSettings)

Occurs when importing pages.

> Back to list of event categories

ColumnsTranslationEvents

Namespace: CMS.DataEngine

When transferring data between instances of Kentico (via import/export or staging), the IDs of objects can differ between the environments. Kentico automatically "translates" the ID values for system objects, but not for custom objects. For example, when you stage a custom table or page type that contains a custom field storing object IDs, the values may not match the IDs of the objects on the target server. The ColumnsTranslationEvents allow you to ensure that the IDs are translated correctly.

See also: Deploying objects with custom ID fields

Event

Event types

Handler parameters

Description

RegisterRecords
_______________________

Execute

ColumnsTranslationEventArgs

 Properties
  • ObjectType (string)

  • Data (IDataContainer)

  • TranslationHelper (TranslationHelper)
    ______________________________

Occurs when exporting objects. Allows you to provide additional information for the translation of custom ID fields.

TranslateColumns

Execute
___________

ColumnsTranslationEventArgs

 Properties
  • ObjectType (string)

  • Data (IDataContainer)

  • TranslationHelper (TranslationHelper)
    ______________________________
Occurs when importing objects. Allows you to translate the values of custom ID fields using the provided information.

> Back to list of event categories

BizFormItemEvents

Namespace: CMS.OnlineForms

Contains events related to form actions. See Working with form data using the API for an example.

Event

Event types

Handler parameters

Description

Insert
_______________________

Before
After
Failure

BizFormItemEventArgs

 Properties
  • Item (BizFormItem)

Occurs when inserting new form items (data records of on-line forms).
Update

Before
After
Failure

BizFormItemEventArgs

 Properties
  • Item (BizFormItem)

Occurs when updating form data records.
Delete

Before
After
Failure
___________

BizFormItemEventArgs

 Properties
  • Item (BizFormItem)

Occurs when deleting data records from forms.

> Back to list of event categories

EcommerceEvents

Namespace: CMS.Ecommerce

Contains events related to the E-commerce solution.

Event

Event types

Handler parameters

Description

NewOrderCreated

Execute

NewOrderCreatedEventArgs

 Properties
  • NewOrder (OrderInfo)

Fires when a new order is created.

The event triggers only when the order is made through the shopping cart, not when the order is created with code.

OrderPaid

_______________________

Execute 

___________


OrderPaidEventArgs

 Properties
  • Order (OrderInfo)

Fires when an order becomes paid.

> Back to list of event categories

NewsletterEvents

Namespace: CMS.Newsletters

Contains events related to Email marketing.

EventEvent typesHandler parametersDescription
ResolveMacros
_______________________
Before
After
Failure __________

ResolveMacrosEventArgs

 Properties
  • MacroResolver (MacroResolver)
  • TextToResolve (string)
  • Newsletter (NewsletterInfo)
  • IssueInfo (IssueInfo)_______________________
Fires when all newsletter text macros are being resolved.
GenerateQueueItemsBefore
After
Failure _

GenerateQueueItemsEventArgs

 Properties
  • Subscriber (SubscriberInfo)
  • Issue (IssueInfo)
  • EmailAddressBlocker (IEmailAddressBlocker)
  • GeneratedEmails (HashSet<string>)_______________________
 Occurs when a campaign email is sent to one or more subscribers. You can use this event to manually add emails to the queue for custom subscriber.
GeneratePreviewBefore
After
Failure 

GeneratePreviewEventArgs

 Properties
  • Subscriber (SubscriberInfo)
  • Issue (IssueInfo)
  • PreviewHtml (string)_______________________
 Occurs when an email preview is generated for a subscriber.
SubscriberUnsubscribesExecute

UnsubscriptionEventArgs

 Properties
  • Newsletter (NewsletterInfo)
  • Email (string)
  • IssueID (int?)_______________________
 Occurs when a subscriber unsubscribes from an email campaign.
SubscriberOpensEmailExecute

LinksEventArgs

 Properties
  • IssueInfo (IssueInfo)
  • NewsletterInfo (NewsletterInfo)
  • AdditionalParameters (NameValueCollection) ____________________
 Occurs when a subscriber opens an email and the open email tracking feature is enabled.
SubscriberClicksTrackedLinkExecute

LinksEventArgs

 Properties
  • IssueInfo (IssueInfo)
  • NewsletterInfo (NewsletterInfo)
  • AdditionalParameters (NameValueCollection) ____________________
 Occurs when a subscriber clicks an email link and the email link tracking feature is enabled.

> Back to list of event categories

WebAnalyticsEvents

Namespace: CMS.WebAnalytics

Event

Event types

Handler parameters

Description

LogConversion
_______________________

Before
After
Failure
___________

CMSEventArgs<LogRecord>

 Properties
  • Conversion (LogRecord)
    _______________________

Occurs when a conversion is logged.

ProcessLogRecordBefore
After
Failure

CMSEventArgs<LogRecord>

 Properties
  • LogRecord (LogRecord)
    ______________________

Occurs when the web analytics log is being processed.
ProcessAnalyticsServiceBefore
After
Failure  

AnalyticsJSEventArgs

 Properties
  • QueryParameters (Dictionary<string, string>) 

 Occurs when the system logs any web analytics.
 InsertAnalyticsJS Before
After
Failure

 AnalyticsJSEventArgs

 Properties
  • QueryParameters (Dictionary<string, string>) 

 Occurs when the web analytics JavaScript snippet is inserted into the page.
CampaignLaunchedExecuteCMSEventArgs<CampaignInfo>Occurs when a campaign is launched.
CampaignUTMChangedExecuteCMSEventArgs<CampaignUTMChangedEventArgs>Occurs when the UTM parameter is changed for a campaign.

> Back to list of event categories

ActivityEvents

Namespace: CMS.WebAnalytics

Event

Event types

Handler parameters

Description

ActivityLogged
_______________________

Before
After
Failure
___________

ActivityLoggedEventArgs

 Properties
  • ActivityData (ActivityData)_______________________

Fires immediately when on-line marketing activities of any type occur in the system.

> Back to list of event categories

ContactManagementEvents

Namespace: CMS.OnlineMarketing

Event

Event types

Handler parameters

Description

ProcessContactActionsBatch
_______________________

Before
After
Failure
___________

ProcessContactActionsBatchEventArgs

 Properties
  • LoggedActivities (IList<ActivityData>)

Fires when contact actions batch is being processed by the system.

> Back to list of event categories

AutomationEvents

Namespace: CMS.Automation

Contains events related to marketing automation actions.

Event

Event types

Handler parameters

Description

MoveToNextStep
_______________________

Before
After
Failure

AutomationEventArgs

 Properties
  • InfoObject (BaseInfo)

  • StateObject (AutomationStateInfo)

  • PreviousStep (WorkflowStepInfo)

Occurs when an automation process moves to the next step.
MoveToPreviousStep

Before
After
Failure

AutomationEventArgs

 Properties
  • InfoObject (BaseInfo)

  • StateObject (AutomationStateInfo)

  • PreviousStep (WorkflowStepInfo)

Occurs when an automation process moves back to the previous step.
Action

Before
After
Failure
___________

WorkflowActionEventArgs<BaseInfo, AutomationStateInfo, AutomationActionEnum>

Requires references to:

  • CMS.WorkflowEngine
  • CMS.DataEngine
Occurs when the system executes a marketing automation action step.
ProcessTrigger

Before
After
Failure

AutomationProcessTriggerEventArgs

 Properties
  • Options (TriggerOptions)

  • TriggerInfo (ObjectWorkflowTriggerInfo)

Occurs when processing triggers for automation processes.

Evaluates the trigger condition and allows you to, for example, insert data into the condition.

> Back to list of event categories

OutputFilterEvents

Namespace: CMS.OutputFilter

Contains events related to output filters.

Event

Event types

Handler parameters

Description

SaveOutputToCache
_______________________

Before
After
Failure
___________

OutputCacheEventArgs

 Properties
  • Output (CachedOutput)
  • ViewMode (ViewModeOnDemand)
  • FallbackToRegularLoad (bool)
Fires when an output filter saves the output to the cache.
SendCacheOutput

Before
After
Failure

OutputCacheEventArgs

 Properties
  • Output (CachedOutput)
  • ViewMode (ViewModeOnDemand)
  • FallbackToRegularLoad (bool)
Fires before content from the output cache is sent as a response. Occurs only if the cached output is found, and if the cached output gives an opportunity to the user to change the output or to bypass caching entirely.
CurrentFilter.OnBeforeFiltering
  • filter (ResponseOutputFilter)
  • finalHtml (ref string)
Fires before output filtering occurs. See Making custom modifications to output HTML.
CurrentFilter.OnAfterFiltering
  • filter (ResponseOutputFilter)
  • finalHtml (ref string)
Fires after output filtering occurs. See Making custom modifications to output HTML.

> Back to list of event categories

URLRewritingEvents

Namespace: CMS.URLRewritingEngine

Contains events related to URL rewriting and page redirection.

Event

Event types

Handler parameters

Description

PageNotFound
_______________________

Before
After
Failure
___________

URLRewritingEventArgs

 Properties
  • Parameters (URLRewritingParams)

Occurs when the system redirects users to a Page not found error page (after requesting a URL that returns a 404 HTTP status code).
ProcessRewritingResult

Before
After
Failure

 URLRewritingEventArgs

 Properties
  • Parameters (URLRewritingParams)

Occurs at the end of the rewriting process for all URLs. If there are redirects during the rewriting, the event is only triggered for the final URL at the end of the process.

Use the Before event if you need to perform custom rewriting. To avoid the default rewriting steps, set the URLRewritingEventArgs.Parameters.Status property to RequestStatusEnum.PathRewritten.

Use the After event to perform additional custom actions after the default rewriting.

ProcessABTestExecute

ProcessABTestEventArgs

 Properties
  • PageInfo (PageInfo)
  • ReturnedPageInfo (PageInfo)
  • SiteName (String)
  • ViewMode (ViewModeEnum)
Occurs when the system starts rewriting the URL of a page with a running A/B test.

> Back to list of event categories

SystemEvents

Namespace: CMS.Base

Contains general system events.

Event

Event types

Handler parameters

Description

Exception
_______________________

Execute
___________

SystemEventArgs

 Properties
  • Exception (Exception)

  • LogException (bool)

Fires when an unhandled exception occurs in the system.

> Back to list of event categories

SiteEvents

Namespace: CMS.SiteProvider

Contains events related to site actions.

Event

Event types

Handler parameters

Description

Delete
_______________________

Before
After
Failure
___________

SiteDeletionEventArgs

 Properties
  • User (UserInfo)

  • Context (CMSActionContext)

  • Info (DeletionInfo)

Occurs when a site is deleted from the system.

> Back to list of event categories

SqlEvents

Namespace: CMS.DataEngine

Contains events related to the execution of queries and other database operations.

Event

Event types

Handler parameters

Description

ExecuteQuery
_______________________

Before
After
Failure
___________

ExecuteQueryEventArgs<DataSet>

 Properties
  • Connection (IDataConnection)

  • Query (QueryParameters)

  • Result (DataSet)

Occurs when the system executes a database query.

See also: Working with database queries in the API

ExecuteNonQuery

Before
After
Failure

ExecuteQueryEventArgs<int>

 Properties
  • Connection (IDataConnection)

  • Result (DataSet)

Occurs when the system executes a non-query database operation.

ExecuteScalar

Before
After
Failure

ExecuteQueryEventArgs<object>

 Properties
  • Connection (IDataConnection)

  • Query (QueryParameters)

  • Result (DataSet)

Occurs when the system executes a scalar query.
ExecuteReader

Before
After
Failure

ExecuteQueryEventArgs<DbDataReader>

 Properties
  • Connection (IDataConnection)

  • Result (DataSet)

Occurs when the system runs a database DataReader.

> Back to list of event categories

Application events

Kentico provides a set of events that you can use to customize the global behavior of the application.

ApplicationEvents

Namespace: CMS.Base

Contains events related to the application life cycle.

The following table lists the events that occur once in the application's life cycle, in order of execution:

Event

Event types

Handler parameters

Description

PreInitialized
_______________________
Execute
___________
EventArgs
___________________

Occurs when the application finishes pre-initialization (preparation of things unrelated to the database).

Handlers need to be assigned in the PreInit method of modules or CMSLoaderAttribute classes in App_Code.

InitializedExecuteEventArgsOccurs when the application finishes initialization and starts (including all modules and the database connection). Handle this event to perform standard application start events.
PostStartExecuteEventArgsOccurs at the end of the first application request. Allows you to perform asynchronous tasks needed for application startup that do not influence the output of requests.
End

Execute

EventArgs

Occurs when the application ends.

The following events occur as needed during the application life cycle:

Event

Event types

Handler parameters

Description

Error

Execute

EventArgsFires when an error occurs in the application.
SessionStartExecuteEventArgsOccurs when an HTTP session starts for a client.
SessionEndExecuteEventArgsOccurs when an HTTP session ends for a client. May not be raised if the application is configured to use a session state mode different than InProc.
GetVaryByCustomString
_______________________
Execute
___________

GetVaryByCustomStringEventArgs

 Properties
  • Result (string)

  • Context (HttpContext)

  • Custom (string)

Occurs when the application processes variables in custom names of output cache keys.

RequestEvents

Namespace: CMS.Base

Contains events related to handling of requests. See also: ASP.NET Application Life Cycle Overview

The following table lists the request events in order of execution:

Event

Event types

Handler parameters

Description

PrepareExecute

EventArgs

Occurs before the request processing begins.
BeginExecute

EventArgs

Occurs when the request processing starts.

AuthenticateExecuteEventArgsOccurs when authenticating requests.
AuthorizeExecuteEventArgsOccurs when authorizing requests. If the application loads the response from the output cache, the life cycle skips to the End event.
PostAuthorizeExecuteEventArgsOccurs after the request's user is authorized.
PostResolveRequestCacheExecuteEventArgs

Occurs when ASP.NET bypasses execution of the current handler and allows a caching module to serve the request from the cache. Not used by the Kentico output caching (see the Authorize event).

The system performs URL rewriting during the event. After this event, the application can access the context of the displayed page and current page (page info).

MapRequestHandlerExecuteEventArgs

Occurs when a handler is selected to respond to the request.

PostMapRequestHandlerExecuteEventArgs

Occurs after the application has mapped the request to the appropriate event handler.

AcquireRequestState

Execute

EventArgs

Occurs when acquiring the state (for example session state) that is associated with the current request.

PostAcquireRequestStateExecuteEventArgsOccurs after the request state (for example session state) that is associated with the current request has been obtained.
EndExecuteEventArgsOccurs at the end of the request processing (last chance to perform actions before the client receives the response).
RunEndRequestTasksExecuteEventArgsAllows you to execute background tasks at the end of the request processing, but cannot influence the response sent to the client.
Finalize
_______________________
Execute
___________
EventArgs
___________________
Occurs when the request is finalized. Use to cleanup and release any resources used by the request.

Handling other HttpApplication events

If you wish to handle HttpApplication events that are not available in the Kentico RequestEvents class, you need to create and register a custom HTTP module. You can implement the module in the App_Code folder of web site projects or as part of a custom assembly.

See Walkthrough: Creating and Registering a Custom HTTP Module for more information.

SessionEvents

Namespace: CMS.Membership

Contains events related to session management.

Event

Event types

Handler parameters

Description

UpdateSession

Before
After
Failure

CMSEventArgsOccurs when an HTTP session is updated.

UpdateSessionData

_______________________

Execute
___________


CMSEventArgs<SessionInfo>

 Properties
  • Parameter (SessionInfo)

Occurs when the data of an HTTP session is updated.

> Back to list of event categories

Control and page events

You can handle events related to the life cycle of pages and controls. The events are defined directly in the base classes of system pages and controls. You can leverage the events to customize the user interface. The events are direct delegates.

AbstractUserControl

Namespace: CMS.ExtendedControls

Contains events that occur during the user control life cycle.

Event

Handler parameter

Handler return type

OnBeforeUserControlInitEventArgsbool
OnAfterUserControlInitEventArgsvoid
OnBeforeUserControlLoadEventArgsbool
OnAfterUserControlLoadEventArgsvoid
OnBeforeUserControlPreRenderEventArgsbool
OnAfterUserControlPreRenderEventArgsvoid
OnBeforeUserControlRenderHtmlTextWriterbool
OnAfterUserControlRenderHtmlTextWritervoid

Return true in Before handlers to perform the default system actions for the given event.

CMSPage

Namespace: CMS.UIControls

Contains events that occur during the system page life cycle.

Event

Handler parameter

Handler return type

OnBeforePagePreInitEventArgsbool
OnAfterPagePreInitEventArgsvoid
OnBeforePageInitEventArgsbool
OnAfterPageInitEventArgsvoid
OnBeforePageLoadEventArgsbool
OnAfterPageLoadEventArgsvoid
OnBeforePagePreRenderEventArgsbool
OnAfterPagePreRenderEventArgsvoid
OnBeforePageRenderHtmlTextWriterbool
OnAfterPageRenderHtmlTextWritervoid

Return true in Before handlers to perform the default system actions for the given event.

> Back to list of event categories