Reputation: 13
i'm new to membership. i have a table named contact, with a field, userId that must get its data from the membership users table. so when a user is created i have to get the userId from membership users table. how can i do that? thanx in advance
Upvotes: 1
Views: 1791
Reputation: 6001
Use the ProviderUserKey property of the MembershipUser object:
http://msdn.microsoft.com/en-us/library/system.web.security.membershipuser.provideruserkey.aspx
So say:
MembershipUser user = Membership.CreateUser("foo","password");
user.ProviderUserKey
Upvotes: 2