Here is a small code sample which will activate featrue using C#
In this sample we i am checking feature is activated or not and installed or not before trying to activate
// This is to check if feature is installed or not
if (SPFarm.Local.FeatureDefinitions[new Guid("94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb")] != null)
{
//This is to check feature is activated or not
if (web.Features[new Guid("94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb")] != null)
web.Features.Remove(new Guid("94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb"));
}
Thank you !!!
Hi Srikanth,
ReplyDeleteNice Sharepoint Blog,all of your posts are really very useful,thanks for sharing them.
Sharepoint Development