Search code examples
silverlightasp.net-membershipuser-registration

Access user's id (Guid type) in UserRegistrationService service


On my silverlight app authentication/registration I use ASP Membership API and I just want to get the id of the user, right after he's created (I suppose after Membership.CreateUser() function call), because I have to insert new data in a table which has user's id as an foreign key. Thanks.


Solution

  • MembershipUser membershipUser = Membership.CreateUser(...);
    Guid userId = (Guid)membershipUser.ProviderUserKey;