SP2010: Using custom user profile properties on an ASPX for custom profile tab
-
06-12-2019 - |
سؤال
I'm trying create a new profile tab with some customer user properties. I've added the user properties following these StackExchange instructions. I was also able to create a new tab with some help from Mr. Oryszak. Finally, I used SPSWC:ProfilePropertyValue to get the new property values to display on my new tab, as in this code:
Hobbies: <SPSWC:ProfilePropertyValue PropertyName="Hobbies" dir="ltr" runat="server"/>
I'm not sure about a few things, and I think they're all related enough to be one question.
- Is there a tag I can use to get the display name of the property rather than "hard-coding" it into an ASPX page?
- How can I get all of the values of a multi value string property? I just get back the first one with an ellipsis using that tag.
- Can I make a property that acts as a lookup, or is there a way to restrict the multi-value string property to specific values?
Thanks!
المحلول
Trying to answer all 3 questions:
For display name, you should be able to use ProfilePropertyDisplayName (in same namespace as ProfilePropertyValue)
In Central Admin, go to Your User Profile Service > Manage User Properties > Locate and Edit your multi-value user property. In edit property page, locate following setting and change it: Maximum number of values to show before displaying ellipsis:
Custom multi value User Profile property can be configured to pick a value from a term set defined in Managed Metadata Term Store. This would restrict user to choose from values defined with the term set.