Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Another kind of event receiver you may find helpful is a feature receiver, which runs your code when a SharePoint feature is activated, deactivated, installed, or updated (with the same ing variations available as well). This allows you to do any kind of setup or cleanup that can’t be handled in the declarative feature.xml and other files associated with your project.
To show this, add a simple feature receiver to the FAQ solution to add an initial question to the list when it is provisioned. To create the feature receiver, go to Solution Explorer in Visual Studio, and under the Features folder, find the web level feature that contains the FAQ list instance (probably Feature2 if you did the project in the same order as the chapter). Right-click the feature and click Add Event Receiver as shown in Figure 2.22. Visual Studio creates a class derived from SPFeatureReceiver, which you can edit to add your event code.