Membership - Getting User Id after CreateUser

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
 
P

Petar Atanasov

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top