#Application startup events & event registration In order to bind to certain events in the Umbraco application you need to make these registrations during application startup. Based on the Umbraco version you are using there are various ways to hook in to the application starting. The higher the version you are using the more robust this becomes.
In all of the samples below, they show you how to setup an object to execute during Umbraco application startup so that you can subscribe to the Document.BeforePublish event.
#Using ApplicationEventHandler to register events ###Applies to: Umbraco 6.1.0+
The ApplicationEventHandler is a new robust way to hook in to the Umbraco application startup process. It is a base class so all you need to do is override the methods that you wish to handle. It is important to know the difference between each of the methods (information is below). Most of the time you will just want to execute code on the ApplicationStarted method.