SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In SharePoint 2010, I have created a custom user profile property named "MyCustomTools" in central admin as user Administrator.

Then I went to central admin and edit user profile and added vales in "MyCustomTools" as "Google;Facebook".

Now I want to retrieve values of custom properties like Google as link with url and Facebook as link with url. I am able to retrieve custom property name using below code:

new protected void Page_Load(object sender, EventArgs e)
            using (SPSite site = new SPSite("servername"))
                SPServiceContext context = SPServiceContext.GetContext(site);
                ProfileSubtypeManager psm = ProfileSubtypeManager.Get(context);
                ProfileSubtype ps = psm.GetProfileSubtype(ProfileSubtypeManager.GetDefaultProfileName(ProfileType.User));
                //Get the properties
                ProfileSubtypePropertyManager pspm = ps.Properties;
                foreach (ProfileSubtypeProperty profileSubtypeProperty in pspm.PropertiesWithSection)
                    if (profileSubtypeProperty.Name == "MyCustomTools")
                        Label1.Text += profileSubtypeProperty.Name;

but I need to retrieve values.

share|improve this question

Getting the value is pretty straight forward though this is best answered by looking at the code in this other question on this forum. That question is a little bit different from this one but provides a good example.

The .Value property will return a UserProfileValueCollection that you can iterate through to get the individual values.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.