Which code segment should you add to the Web Part?

You create a Feature named Feature1. Feature1 is activated in a SharePoint site.
You 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"];
You need to modify the Web Part to activate Feature1 in Site1 only.
Which code segment should you add to the Web Part?
A. site.Features.Add(feature.Id);
B. site.WebApplication.WebService.Features.Add(feature.Id);
C. web.Features.Add(feature.Id);
D. web.Site.WebApplication.WebService.Features.Add(feature.Id);

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.