How to Store Multiple Value In Session using asp.net c#
We can add multiple values by using class entiry or hashtable or arralist:
Here a we will use Hashtable for storing multiple value in session
Hashtable htEmpInfo = new Hashtable();
htEmpInfo.Add("Name", "Santosh");
htEmpInfo.Add("Designation", "SE");
htEmpInfo.Add("Department", "MS");
session["EmpDetails"]=htEmpInfo;
Retrieving the values from the session
Hashtable htEmpInformaiton = (Hashtable)session["EmpDetails"];
lblEmopName.Text=htEmpInformaiton["Name"].ToString();
lblDesignation.Text=htEmpInformaiton["Designation"].ToString();
Thank you :D
ReplyDeleteBig Salute for you man...
ReplyDeleteVery Usefull to me...Thanks.
ReplyDeleteHashtable htEmpInformaiton = (Hashtable)session["EmpDetails"];
ReplyDeletegiving error at session