Results 1 to 4 of 4

Thread: [RESOLVED] [2005] ProfileManager, Update User Profile?

  1. #1

    Thread Starter
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Resolved [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
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] ProfileManager, Update User Profile?

    Membership.GetUser() is overloaded, you can use another method to get a user and update their details.

  3. #3

    Thread Starter
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    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?
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  4. #4

    Thread Starter
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    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
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width