[RESOLVED] [2005] ProfileManager, Update User Profile?
I don't see a method in the ProfileManager class that lets me update a user's profile. I know that I can use the Profile class for the currently authenticated user, but I want to enable the administrators to edit a user's profile. How can I achieve this? Can it be done using the ProfileManager?
Note: I am using the following:
SqlMembershipProvider
SqlProfileProvider
SqlRoleProvider
Re: [2005] ProfileManager, Update User Profile?
Membership.GetUser() is overloaded, you can use another method to get a user and update their details.
Re: [2005] ProfileManager, Update User Profile?
Quote:
Originally Posted by mendhak
Membership.GetUser() is overloaded, you can use another method to get a user and update their details.
Membership.GetUser() returns a MembershipUser object. The MembershipUser does not contain Profile information that is specified by the <Profile> -> <Properties> element in the Web.Config.
Any other ideas?
Re: [2005] ProfileManager, Update User Profile?
I was able to get an answer on another forum.
For those that may find this thread later, I ended up using the ProfileCommon class to manage a user's profile. Here is a code example.
Code:
' This example assumes there are profile properties FirstName and LastName
Public Sub UpdateUserProfile(ByVal username As String)
Dim usersProfile as ProfileCommon = New ProfileCommon
userProfile = Profile.GetProfile(username)
With userProfile
.FirstName = FirstNameTextBox.Text
.LastName = LastNameTextBox.Text
End With
userProfile.Save()
End Sub