locked
Userid of newly created user RRS feed

  • Question

  • User-765376745 posted

    Hi,

    Our application lets the administrator create new users. Since the administrator is logged in, I have set  Logincreateduser = false so that the administrator is not logged out even after creating the new user.

    The problem is :I need the userid of the newly created user to store additional details of the user in another database table. I see that i can get the username using Createuserwizard1.username; but how do I get the userID?

    Thanks

    Wednesday, November 10, 2010 2:58 PM

Answers

  • User-862012937 posted

    Dim Username as string = 'however you are getting the username of the newly created user
    Dim myObject As MembershipUser = Membership.GetUser(Username)
    Dim UserId As String = myObject.ProviderUserKey.ToString()
    


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 10, 2010 4:11 PM

All replies

  • User-862012937 posted

    Dim Username as string = 'however you are getting the username of the newly created user
    Dim myObject As MembershipUser = Membership.GetUser(Username)
    Dim UserId As String = myObject.ProviderUserKey.ToString()
    


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 10, 2010 4:11 PM
  • User-765376745 posted

    Thankyou, that works. 

    Wednesday, November 10, 2010 8:27 PM