Click here to Skip to main content
15,746,302 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
Could you please help me to get Logggedinuser(username)from Session.

Regards
Lancy
Posted

Session value is not something which gets generated itself, if you kept it in session then only you will be able to retrieve it.

This may help,
http://msdn.microsoft.com/en-us/library/aa287606(v=vs.71).aspx[^]
 
Share this answer
 
Hi,

Please be more specific while asking a question.
What you have tried ? Provide at-least some code snippet so that we can figure out where you are making a mistake.

Assuming you are writing your own code to validate the user credentials,
after checking the credentials if they are valid please place the corresponding username in session by

C#
session["name"]=username(may be username textbox.text)


wherever you wanna access it

C#
if(session["name"]!=null)
{
lblUsername(your label name).text=session["name"].toString();
}


Hope this helps

Regards
Sriman
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900