So, in the previous posts we’ve looked at how to resolve a MembershipGroupId for a group (or at least, one way of doing so), and how to list users. Now, how do we add new users to our group?
Well, on our ‘list of users’ page, I have what looks like a a SharePoint toolbar. It’s actually just a table cunningly formatted to look like a toolbar, and the ‘Add users’ link on it is a LinkButton. In the codebehind it’s click event is:
protected void BtnAddUsersToGroup_Click(object sender, EventArgs e)
{
int iGroup = (int)ViewState[GROUP];
SPUtility.Redirect("SimpleUG/AddUsers.aspx?MembershipGroupId=" + iGroup, SPRedirectFlags.RelativeToLayoutsPage, this.Context);
}
So, all we’re doing is going to a page called ‘AddUsers’ and passing the MembershipGroupId again. Continue reading “How I simplified the Users and Group UI – Adding Users”