nerdexam
Microsoft

70-573 · Question #104

You have a custom user profile property named MyProperty. You need to create a Web Part that displays the value of MyProperty for the current user. Which code segment should you use?

The correct answer is D. UserProfileManager profileManager = new. MNEMONIC RULE: GetPropertyByName userProfile.Properties is ProfileSubtypePropertyManager object. See its members in this MSDN article: ProfileSubtypePropertyManager Members us/library/microsoft.office.server.userprofiles.profilesubtypepropertymanager_members.aspx See the sample…

Developing for User Experience

Question

You have a custom user profile property named MyProperty. You need to create a Web Part that displays the value of MyProperty for the current user. Which code segment should you use?

Options

  • Astring profile =
  • Bstring profile = SPContext.Current.Web.Users["MyProperty"].ToString();
  • CUserProfileManager profileManager = new
  • DUserProfileManager profileManager = new

How the community answered

(51 responses)
  • A
    2% (1)
  • B
    10% (5)
  • C
    6% (3)
  • D
    82% (42)

Explanation

MNEMONIC RULE: GetPropertyByName userProfile.Properties is ProfileSubtypePropertyManager object. See its members in this MSDN article: ProfileSubtypePropertyManager Members us/library/microsoft.office.server.userprofiles.profilesubtypepropertymanager_members.aspx See the sample code at the link below. Creating profile properties and sections the SharePoint 2010 way-part 2, The code 2010-waypart-2-the-code/

Topics

#user profiles#UserProfileManager#custom profile property#Web Part

Community Discussion

No community discussion yet for this question.

Full 70-573 Practice