How to access custom profile type in UserProfile

Posted by Community Admin on 04-Aug-2018 18:18

How to access custom profile type in UserProfile

All Replies

Posted by Community Admin on 20-Jul-2012 00:00

I have created a new profile type called ContactID and I can't figure out how to access this custom type to update it. Ive been looking at the documentation but I just can figure it out. This is what Ive tried so far.

UserProfileManager profileManager = UserProfileManager.GetManager();
List<
Telerik.Sitefinity.Security.Model.UserProfile> profiles = profileManager.GetUserProfiles(identity.UserId).ToList();
 
foreach (Telerik.Sitefinity.Security.Model.UserProfile p in profiles)
                
                     
                

In the code above I am getting all UserProfiles for the logged in user but I can't figure out how to get to the custom profile type. Would love some help?

thanks

Posted by Community Admin on 20-Jul-2012 00:00

UserProfileManager profileManager = UserProfileManager.GetManager();
                var basicProfile = profileManager.GetUserProfile(identity.UserId, "Telerik.Sitefinity.Security.Model.BasicProfile");
 
                if (basicProfile..GetValue("ContactID") > 0)
                
 
                

So I started to try this but I don't see the GetValue method in the basicProfile object. Any ideas?

This thread is closed