We're developing a custom web part that displays information from a list about the user. We need to determine who's profile page we're on to retrieve the appropriate information from the list. The UserProfileManager needs an account to retrieve a specific profile so that won't work.
|
The query string isn't reliable, it varies depending on how you get to the user's page (eg: clicking "My Profile", browsing from search results, using the pretty url "/personal/username", etc...). From your web part, you can get the profile the same way that all of the controls on the user's profile get it (using the ProfilePropertyLoader):
|
||||
|
|
|
UserProfileManager has two overloads to get user profile - with GetUserProfile(bool bCreateIfNotExist) - this gets user profile, or creates if it is not exists, and GetUserProfile(string strAccountName). |
|||
|
|