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(); PS. You should GUID for UserID if you use SQL Server as a DB
MembershipUser myObject = System.Web.Security.Membership.GetUser();
Guid UserID = new Guid(myObject.ProviderUserKey.ToString());
Keywords :Asp.net, Membership framework
|