How do you change an email in the aspnetdb user the MembershipProvider?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gerry L

    How do you change an email in the aspnetdb user the MembershipProvider?

    I need to give a user the ability to change the email of any other user listed in the aspnetdb. I can easily change their password, but I can't get the email to change. I thought that usr.email = "email@email.co m" would work, but it doesn't. It doesn't error, but it also doesn't change anything.

    This is the basic code:
    Code:
      Dim usr As MembershipUser = Membership.GetUser(userName)
      usr.Email = txtEmail.Text
    Last edited by Frinavale; Oct 15 '10, 01:04 PM.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Did you try calling the Membership.Upda teUser method after changing the password?

    For example:
    Code:
    Dim usr As MembershipUser = Membership.GetUser(userName)
    usr.Email = txtEmail.Text
    Membership.UpdateUser(user)
    -Frinny

    Comment

    Working...