Doubt
Hi any one know, how to two session name into single variable 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, 2:15 PM
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.