Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to get the loged in user ID
Message
From
05/07/2010 10:20:21
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 4.0
Miscellaneous
Thread ID:
01471353
Message ID:
01471398
Views:
31
>>Hi Viv,
>>
>>That worked but as you but it does hit the database again. I guess I could store the value in a session variable so the hit would only happen after the log in. I need this value so I can provide the data that only user owns.
>>
>>The next question is how to cast the string back to a guid or should I just store the guid directly to the session variable if I can?
>>
>>Update: I should have tried google first.
>>
>>Guid guUserid = new Guid(curuserid);
>
>Session variables are stored as objects so why not just store it as a Guid:
Session["UserId"]=GetTheUsersGuid();
>//then to retrieve:
>Guid UserId = (Guid)Session["UserId"];
but see my suggestion in your other post re: using a custom object....
>

I was wondering about that so I will give it a try.

Thanks.
Previous
Reply
Map
View

Click here to load this message in the networking platform