Creating Feature Event Receiver (1)

Visual Studio 2010 doesn’t include a separate project template for feature event receivers. A feature event receiver can be added to a SharePoint feature in a SharePoint project with a few mouse clicks.

Create an empty Sharepoint project, farm solution. There is nothingin the project, so right click Feature, and Add Feature.

Right click Feature1, and click Add Event Receiver —

After that a code behind file is created:

More info:

Next, comment out the FeatureActivated and FeatureDeactivating()

Add code to add lists when feature activated:

And add these to deactivaing:

Deploy and go to the web site and you will see the new lsists created:

If you do a Build à Retract, you will see that the lists removed.

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: