Scenario:
Quickly displaying all the activated feature for a site collection / web
Code:
SPFeatureCollection siteFeatures = SPContext.Current.SiteFeatures;
foreach (SPFeature siteFeature in siteFeatures)
{
Response.Write(siteFeature.Definition.Name);
}
SPFeatureCollection webFeatures = SPContext.Current.SiteFeatures;
foreach (SPFeature webFeature in webFeatures)
{
Response.Write(webFeature.Definition.Name);
}
0 comments:
Post a Comment