How to assion two session variable into single session name
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sukesh MarlaRank #461 · 5.4K reputationPosted Aug 26, 2012, 7:11 PM EDT
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.