0

How Can I get site groups name with using SPcontext in client side?

1
var clientContext = new SP.ClientContext.get_current();

var groupCollection = clientContext.get_web().get_siteGroups();

// Get a particular group
var myGroup = groupCollection.getByName("MyGroup");
1

should be the same as:

server side:

SPGroupCollection groups = SPContext.Current.Web.SiteGroups;

and client side:

clientContext = new SP.ClientContext();

var groupCollection = clientContext.get_web().get_siteGroups();

its grabbing a collection of the current web groups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.