In SharePoint 2007 (WSS3 - MOSS) è possibile attivare una feature via codice aggiungendola alla collection Features dell'oggetto SPWeb o SPSite tramite il suo Guid.

Questo è un esempio in C#:

C#

string url = "http://sharepoint2007";
using (SPSite site = new SPSite(url))
{
   SPWeb web = site.RootWeb;
   Guid g = new Guid("94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb");
   SPFeature f = web.Features[g];
   web.Features.Add(g);
}
Tags:
C#235 Object Model9 SharePoint498 SharePoint 2007218 SharePoint 2010224 SharePoint 2013137 SharePoint 201668
Potrebbe interessarti anche: