Which code condition should you use?

You need to create a Web Part that verifies whether a user who accesses the Web Part page is a member of a group named Group1.
Which code condition should you use?
A. SPContext.Current.Web.Groups["Group1"].ContainsCurrentUser;
B. SPContext.Current.Web.SiteUsers[SPContext.Current.Web.CurrentUser.ID].Groups["Group1"] != null;
C. SPContext.Current.Web.SiteUsers[SPContext.Current.Web.CurrentUser.ID].Groups["Group1"] == null;
D. SPContext.Current.Web.Users["Group1"].IsDomainGroup;

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.