Membership - Getting User Id after CreateUser

  • Thread starter Thread starter mazdotnet
  • Start date Start date
M

mazdotnet

Hi,

I like to grab the user id of the currently added user. However, I
can't find a property that would do it.

MembershipUser newUser = Membership.CreateUser(tbxUsername.Text,
tbxPassword.Text,

tbxEmail.Text, "empty",
"empty",
true, out status);

I need something that would give me the newUser.UserID (database user
id)

Also, I had to use "empty", "empty" for the password question. If I
leave it empty, it says that password question not valid. Any way
around this?

Thanks
Maz
 
mazdotnet said:
Hi,

I like to grab the user id of the currently added user. However, I
can't find a property that would do it.

MembershipUser newUser = Membership.CreateUser(tbxUsername.Text,
tbxPassword.Text,

tbxEmail.Text, "empty",
"empty",
true, out status);

I need something that would give me the newUser.UserID (database user
id)

Also, I had to use "empty", "empty" for the password question. If I
leave it empty, it says that password question not valid. Any way
around this?

Thanks
Maz

look at newUser.ProviderUserKey

HTH,
Petar Atanasov
http://a-wake.net
 
Back
Top