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…
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)- A2% (1)
- B10% (5)
- C6% (3)
- D82% (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
Community Discussion
No community discussion yet for this question.