views:

43

answers:

1

i know how to get userid for a current user MembershipUser currentUser = Membership.GetUser(); Guid currentUserId = (Guid)currentUser.ProviderUserKey; But for my application i need to get userid of user who are not loginned in also. Because i need to assign the userid to different table which i m using.

Thank you in Advance

+1  A: 

Use the Membership.GetUser(username, userIsOnline) method, passing false as the userIsOnline parameter.

technophile
+1 - ding ding ding - give the man a prize..
Sky Sanders
Ok, technophile gave you what you need but let me be a bit more explicit, if necessary to get you where you need to be...`var userId = (Guid)(Membership.GetUser(username,false).ProviderUserKey);`
Sky Sanders