I need to programmatically, using C#, add the SharePoint Web Part "Site Users" to a page.
I know how to add web parts but how do I get the "Site Users" web part from Share Point? I do not know how to instance it.
Thanks for helping.
I need to programmatically, using C#, add the SharePoint Web Part "Site Users" to a page.
I know how to add web parts but how do I get the "Site Users" web part from Share Point? I do not know how to instance it.
Thanks for helping.
The answer turned out to be the Members Web Part.
By simply setting "Display Type" to "WebUserGroups" the web part lists the groups and users on the site.
MembersWebPart membersWebPart = new MembersWebPart();
membersWebPart.DisplayType = MembersWebPartDisplayType.WebUserGroups;
membersWebPart.Title = "Användare och grupper";
wpManager.AddWebPart(membersWebPart, "Right", 2);