getting UserId of newly created user by CreateUserWizard

Discussion in 'ASP .Net' started by Adam Right, Feb 23, 2008.

  1. Adam Right

    Adam Right Guest

    Hi All,

    I can find UserId of an Authenticated user over the ProviderUserKey of
    MembershipUser , like that:

    if(Page.User.Identity.IsAuthenticated)
    {
    MembershipUser usr = Membership.GetUser(Page.User.Identity.Name);
    Label1.text = usr.ProviderUserKey.ToString();
    }

    But, is it possible to get the UserId of just created user in CreatedUser
    event of CreateUserWizard ?

    I need UserID to insert some extra information not supported by
    CreateUserWizard and i have to insert them in CreatedUser event...

    Any idea ?

    Thanks....

    Adam
     
    Adam Right, Feb 23, 2008
    #1
    1. Advertising

  2. Adam,

    Did you ever figure this out?

    Keith

    "Adam Right" <AdamRight> wrote in message
    news:...
    > Hi All,
    >
    > I can find UserId of an Authenticated user over the ProviderUserKey of
    > MembershipUser , like that:
    >
    > if(Page.User.Identity.IsAuthenticated)
    > {
    > MembershipUser usr = Membership.GetUser(Page.User.Identity.Name);
    > Label1.text = usr.ProviderUserKey.ToString();
    > }
    >
    > But, is it possible to get the UserId of just created user in CreatedUser
    > event of CreateUserWizard ?
    >
    > I need UserID to insert some extra information not supported by
    > CreateUserWizard and i have to insert them in CreatedUser event...
    >
    > Any idea ?
    >
    > Thanks....
    >
    > Adam
    >
    >
    >
    >
    >
    >
     
    Keith G Hicks, Mar 1, 2008
    #2
    1. Advertising

  3. Adam Right

    Guest

    On Mar 1, 3:33 pm, "Keith G Hicks" <> wrote:
    > Adam,
    >
    > Did you ever figure this out?
    >
    > Keith
    >
    > "Adam Right" <AdamRight> wrote in message
    >
    > news:...
    >
    >
    >
    > > Hi All,

    >
    > > I can find UserId of an Authenticated user over the ProviderUserKey of
    > > MembershipUser , like that:

    >
    > > if(Page.User.Identity.IsAuthenticated)
    > > {
    > > MembershipUser usr  = Membership.GetUser(Page.User.Identity.Name);
    > > Label1.text = usr.ProviderUserKey.ToString();
    > > }

    >
    > > But, is it possible to get the UserId of just created user in CreatedUser
    > > event of CreateUserWizard ?

    >
    > > I need UserID to insert some extra information  not supported by
    > > CreateUserWizard and i have to insert them in CreatedUser event...

    >
    > > Any idea ?

    >
    > > Thanks....

    >
    > > Adam- Hide quoted text -

    >
    > - Show quoted text -


    Here's an example:

    Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As
    Object, ByVal e As System.EventArgs) Handles
    CreateUserWizard.CreatedUser

    Dim User As MembershipUser =
    Membership.GetUser(CreateUserWizard.UserName)

    Dim UserGUID As Guid = CType(User.ProviderUserKey, Guid)

    End Sub
     
    , Mar 6, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Earl Teigrob
    Replies:
    0
    Views:
    328
    Earl Teigrob
    Aug 5, 2003
  2. David Lozzi

    Get newly created record's ID??

    David Lozzi, Dec 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    407
    Jacco Schalkwijk
    Dec 7, 2004
  3. Replies:
    0
    Views:
    366
  4. mazdotnet
    Replies:
    0
    Views:
    669
    mazdotnet
    Sep 12, 2007
  5. Rodusa
    Replies:
    7
    Views:
    335
    Dominick Baier [DevelopMentor]
    Dec 29, 2005
Loading...

Share This Page