Karatas, FERHAT
I would love to change the world, but they won't give me the source code!
Get the UserID of the User
7.7.2008 18:19:43 - Filed under : Asp.net
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
with 0 comments

What do you think ?
Security Code 7100
Check S. Code
Name  
Email  
Home Page  
Comments