Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where to get the loged in user ID
Message
De
05/07/2010 10:20:21
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
 
À
05/07/2010 04:20:07
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 4.0
Divers
Thread ID:
01471353
Message ID:
01471398
Vues:
32
>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform