How to store a seesion variable? [Resolved]

Posted by Sridevi under C# on 4/11/2012 | Points: 10 | Views : 907 | Status : [Member] | Replies : 4
How to store a session variable and access it in code?

Sridevi


Responses

Posted by: Self-Innovator on: 4/11/2012 [Member] Bronze | Points: 50

Up
0
Down

Resolved
Login.aspx
string UserId = txtUser.Text.Trim();

Session["UserId"] = UserId;

Home.aspx
In page Load
lblWelcome.Text =" Welcome User "+ Session["UserId"].ToString();


Join Hands Change lives
Thanks & Regards
Straight Edge Society

Sridevi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajni.Shekhar on: 4/11/2012 [Member] Bronze | Points: 25

Up
0
Down
Session["myValue"]="any value";

string strSession=Session["myValue"].ToString();


Thanks,
Rajni Shekhar

Sridevi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 4/11/2012 [Member] Starter | Points: 25

Up
0
Down
u r right Mr Join Hands Change lives

Thanks & Regards
Hari

Sridevi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/11/2012 [Member] Silver | Points: 25

Up
0
Down
Thank you Self_innovator

Regards,
Singaravel M

Sridevi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response