I;m using a Dictioanry collection to store FirstName using SessionID as key. then i store it in a session object. I need to extract the first Name from the user's home page.
|
How do i search the FirstName based on the sessionID from the user's home page? (this is an issue when there are more than one user logged in to the server)
TY
Problem is how do i pass the sessionID to the user's home page
Kirtan PatelPosted Oct 26, 2009, 11:33 PM
Here is Solution ..For Finding Key From Value Write a Function Like below
check "Do you like this answer" if it helps you :)
public string FindKeyByValue(Dictionary<string, string> myDic, string ValueWhichYouWantoUsAsKey )
{
foreach (string key in myDic.Keys)
{
if (myDic[key] == ValueWhichYouWantoUsAsKey)
{
return key;
}
}
return null;
}
jingePosted Oct 26, 2009, 8:36 PM
like Dic.Add(sessionID, row);
Then you can retrieve value like this:
Dic[SessionID];
Thank you.