Articles about European Sharepoint Hosting Service
SharePoint 2013 Hosting – HostForLIFE.eu :: How to Programmatically Create Custom Group in SharePoint?
In this tutorial, i will tell you about how to Programmatically Create Custom Group in SharePoint. You can Create Custom Group in SharePoint Programmatically when the feature is activated. Sometimes we don’t have admin right on server. In this case we need to make request to install our farm solution in the site. But whats about the Group? If you need to maintain 50 groups then we need to go to the custom development where as soon feture is activated the groups are created in the site. Write the following code and will explain you how to add a group in SharePoint Programmatically.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
public override void FeatureActivated(SPFeatureReceiverProperties properties) { using (SPWeb spWeb = SPContext.Current.Site.RootWeb) { try { spWeb.SiteGroups.Add("Custom Group", spWeb.CurrentUser, null, "Custom Group Test Description"); SPRoleAssignment spRoleAssignment = new SPRoleAssignment(spWeb.SiteGroups["Custom Group"]); SPRoleDefinition con = spWeb.RoleDefinitions["Contribute"]; spRoleAssignment.RoleDefinitionBindings.Add(con); spWeb.RoleAssignments.Add(asgn); } catch (SPException ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } spWeb.Update(); } } |
SharePoint 2013 Hosting Recommendation
HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.
Print article | This entry was posted by Peter on September 27, 2016 at 5:16 am, and is filed under European SharePoint 2013 Hosting. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |