I have created a Feature named Feature1. Feature1 is activated in a SharePoint site. I create a Web Part that contains the following code.
SPSite site = new SPSite("http://intranet/site1"); SPWeb web = site.OpenWeb(); SPFeatureDefinition feature = SPFarm.Local.FeatureDefinitions("Feature1");
I need to modify the Web Part to activate Feature1 in Site1 only.
Should I use? site.Features.Add(feature.Id) or web.Features.Add(feature.Id)
Whats the difference between the two instructions?