How to assion two session variable into single session name
How to assion two session variable into single session name?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sukesh MarlaPosted Aug 26, 2012, 11:11 PM
http://www.c-sharpcorner.com/Forums/Thread/184435/doubt.aspx
here
and that is
Just create a class as follows
Class SessionClass
{
public string Value1;
public string Value2;
}
then,
.
.
.
SessionClass s=new SessionClass();
s.Value1="SomeValue1";
s.Value2="SomeValue2";
Session["MyKey"]=s;
.
.
SessionClass s1=(SessionClass)Session["MyKey"];
Or even you can use any other container like KeyValuePair ,Dictionary or list and then store them in session.
Hope this helped check this is correct answer if it is.