Add a SharePoint groups programmatically to the Quick Launch

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();

}

}

Previous
Next Post »
0 Komentar