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.