I’ve read that question on many message boards so I decided to post a quick blog entry about that. It’s actually very easy.
If you use the new comfortable Login Controls of ASP.NET v2, here is how you resolve the UserID of the currently logged in user:
MembershipUser myObject = Membership.GetUser(); string UserID = myObject.ProviderUserKey.ToString();
That’s all! Hope that helps..