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

I'm trying to debug the code below. For some reason the GetUserProperties Method isn't called during debug. Can someone tell me how i'm able to call it? I wan't to display the user-properties in an extra tab on the my-sites..

    namespace CV.CV
    public class CV : WebPart

        Property propQualifications = null;
        string strQualifications = "";

        public Microsoft.Office.Server.UserProfiles.PropertyCollection GetUserProperties()
            Microsoft.Office.Server.UserProfiles.PropertyCollection oPropertyCollection = null;

            System.Security.PermissionSet ps = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted);

            Microsoft.SharePoint.SPServiceContext serviceContext = Microsoft.SharePoint.SPServiceContext.Current;
            Microsoft.Office.Server.UserProfiles.UserProfileManager upm = new Microsoft.Office.Server.UserProfiles.UserProfileManager(serviceContext);

            oPropertyCollection = upm.PropertiesWithSection;

            propQualifications = oPropertyCollection.GetPropertyByName("Qualifications");
            strQualifications = propQualifications.ToString();




            return oPropertyCollection;
share|improve this question
up vote 1 down vote accepted

You can make a call to your method by overriding either the Page_Load or OnPreRender method of your Web Part.

share|improve this answer
can you be a little more specific? im new to the game ;) – Peter Aug 2 '11 at 9:54
just did it! thanks for the advice! – Peter Aug 2 '11 at 10:19

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.