The Id Value must be unique and will be generated from Tools->Guid Generator".Title ,description and image will be displayed in the feature list of your web site.Scope can be Farm,WebApplication,Site,Web depending on the scenario.ReceiverClass and ReceiverAssembly will be explain in the next section.ElementManifests element will call another xml.

The content will be as followsusing System;using System.Collections.Generic;using System.Linq;using System.Text;using Microsoft.SharePoint;

namespace MyFeature{ public class MyFeatureReceiver:SPFeatureReceiver { public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPWeb site = (SPWeb)properties.Feature.Parent; // SPWeb site = SPContext.Current.Web;//when the scope of the feature is site // track original site Title using SPWeb property bag site.Properties["OriginalTitle"] = site.Title; site.Properties.Update(); // update site title site.Title = "My Feature has been activated"; site.Update(); }

public override void FeatureDeactivating(SPFeatureReceiverProperties properties) { // reset site Title back to its original value SPWeb site = (SPWeb)properties.Feature.Parent; //SPWeb site = SPContext.Current.Web;//when the scope of the feature is site site.Title = site.Properties["OriginalTitle"]; site.Update();