ASP.NET Membership API: Getting the UserId of a user
I got this from Andreas Kraus's Blog; I needed to know how to access the UserId of a user in the ASP.NET Membership API; this turned out to work and be very handy:
“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..
-zach