Posted by : Alon Havivi Friday, August 21, 2009

using

(SPSite site = new SPSite("http://yoursite"))

{

using (SPWeb web = site.OpenWeb())

{

SPGroup group1 = web.SiteGroups["group1"];

SPGroup group2 = web.SiteGroups["group2"];

SPGroup group3 = web.SiteGroups["group3"];

web.Properties[

"vti_associategroups"] = string.Format("{0};{1};{2}", group1.ID.ToString(), group2.ID.ToString(), group3.ID.ToString());

web.Properties.Update();

}

}

Popular Post

- Copyright © Alon Havivi's Blog -