Gautam Buddha Temple Varanasi,Varanasi - Buddhist Pilgrimage

Monday, September 6, 2010

How to Store Multiple Value In Session using asp.net c#

 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();  

5 comments:

  1. Big Salute for you man...

    ReplyDelete
  2. Hashtable htEmpInformaiton = (Hashtable)session["EmpDetails"];

    giving error at session

    ReplyDelete
  3. This is an amazing blog,it gives very helpful messages to us.Besides that Wisen has established as Best Dot Net Training in Chennai. or learn thru ASP.NET Online Training . Nowadays Dot Net has tons of job opportunities on various vertical industry.

    ReplyDelete