Common scenario is you will need the the Identity key of the logged in user
You can achieve it like this:
(Guid)Membership.GetUser().ProviderUserKey
But this will make a call to database , so you may want to store UserID in session or maybe store it in Forms Authentication cookie.
I will update about the Forms Authentication way
No comments:
Post a Comment