Home » SharePoint

Feature Exists (Activated on SPSite)

28. January 2011 by David 0 Comments
Method to iterate through SharePoint SPSite collection to check to 
see if a feature (featureGuid) exists. If found, method returns true.

 

 

private bool FeatureExists(SPSite siteCollection, Guid featureGuid) { 

bool found = false; 

foreach (SPFeature feature in siteCollection.Features) { 

if (feature.DefinitionId == featureGuid) {
found =
true; 

break;

}

}

 

return found;

}

 

Cool eh?



Pingbacks and trackbacks (1)+

Add comment



  Country flag
biuquote
  • Comment
  • Preview
Loading







Current HOT Blog List...

These are blog entries that I have found interesting and are worth checking out.
Forbidden