Scenario:
Someone asked me how to activate features programatically.
Solution:
I told you, I love Object Model. :-)
Code:
SPWeb web = (SPWeb) properties.Feature.Parent;Note:
if (web.Features.Item(new Guid("FEATURE_GUID_VALUE_HERE"")) == null)
{
web.Features.Add(new Guid("FEATURE_GUID_VALUE_HERE"));
}
You can bundle multiple feature activation using this technique.
0 comments:
Post a Comment