nerdexam
Microsoft

70-515 · Question #16

70-515 Question #16: Real Exam Question with Answer & Explanation

Sign in or unlock 70-515 to reveal the answer and full explanation for question #16. The question stem and answer options stay visible for context.

Question

You are creating an ASP.NET Web site. The site is configured to use Membership and Role management providers. You need to check whether the currently logged-on user is a member of a role named Administrators. Which code segment should you use?

Options

  • Abool isMember = Roles.GetUsersInRole("Administrators").Any();
  • Bbool isMember = Membership.ValidateUser(User.Identity.Name,
  • Cbool isMember = Roles.GetRolesForUser("Administrators").Any();
  • Dbool isMember = User.IsInRole("Administrators");

Unlock 70-515 to see the answer

You've previewed enough free 70-515 questions. Unlock 70-515 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 70-515 Practice