View Single Post
  #1 (permalink)  
Old February 26th, 2012, 12:52 PM
sophia sophia is offline
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile store logged in user id in database from class file

Hello all,

I am storing the user id for a record who creates it. It is working fine in aspx.cs file.

myReview.Owner = (Guid)Membership.GetUser().ProviderUserKey;

but when I use the same code in a class file in App_Code folder then it does not work and code breaks.

Is there any other way to get user id in case of class file?

Please help me I am stuck on it for a long time.

Many thanks...
Reply With Quote