Feature class
SharePoint Online
Represents an activated feature.
Namespace: Microsoft.SharePoint.Client
Assembly: Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)
This code example displays the identifiers of the current website’s active features.
using System; using Microsoft.SharePoint.Client; namespace Microsoft.SDK.SharePointFoundation.Samples { class FeatureExample { static void Main() { string siteUrl = "http://MyServer/sites/MySiteCollection"; ClientContext clientContext = new ClientContext(siteUrl); Web site = clientContext.Web; FeatureCollection collFeature = site.Features; clientContext.Load(collFeature); clientContext.ExecuteQuery(); foreach (Feature oneFeature in collFeature) Console.WriteLine("Feature ID: {0}", oneFeature.DefinitionId); } } }
Show: