Community   »   Forums
How to get Users ProfileImageID?
Last Post 20 Jun 2008 08:20 AM by Brokit. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
BrokitUser is Offline
Customers
Posts:3
Avatar

--
20 Jun 2008 08:20 AM  
I need to retrieve a users profile image but it somehow doesn´t work the way I intended. Could you advise a good way to get a users profile image?

Here is my code:

            var user = GetLoggedInUser(); // Gets a valid DNN User
            var imageID = new Guid();

            if (user.UserID == -1)
                return imageID;
           
            var uProfileController = new UserProfileController();
            var uProfile = uProfileController.GetUserProfile(user.PortalID, user.UserID);

            var myProfileController = new MyProfileController();
            var myProfile = myProfileController.GetMyProfileByUserProfileId(uProfile.UserProfileId);

            imageID = myProfile.ProfileImageId;

Although the user has a profile it will throw a null reference. Is there a safe way to build the UserProfileImageURL?

Thanks!
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2008 by Active Modules, Inc.
Social Networking |  Home |  Products |  Services |  Community |  Company |  Buy Now