Sunday, 22 June 2014

Check current User is MemberofGroup or Not?

        SPGroupCollection groupColl = SPContext.Current.Web.SiteGroups;
            SPGroup grp = groupColl["grp1"];
            if (SPContext.Current.Web.IsCurrentUserMemberOfGroup(grp.ID))
                GRP = grp1;
            else
                GRP = "grp2";

No comments:

Post a Comment