Horje
how to add multiple values in session in asp.net visual studio Code Example
how to add multiple values in session in asp.net visual studio
// Saving in session
            System.Collections.Hashtable ht = new System.Collections.Hashtable();
            ht.Add("EmployeeName", "EmpName Value");
            ht.Add("Designation", "Designation Value");
            ht.Add("Department", "Department Value");
            Session["EmployeeInfo"] = ht;
            //Retrieve from session
            if (Session["EmployeeInfo"] != null)
            {
                string strEmployeeName = ht.ContainsKey("EmployeeName") ? Convert.ToString(ht["EmployeeName"]) : "";
                string strDesignation = ht.ContainsKey("Designation") ? Convert.ToString(ht["Designation"]) : "";
                string strDepartment = ht.ContainsKey("Department") ? Convert.ToString(ht["Department"]) : "";
            }




Csharp

Related
C# sprint key Code Example C# sprint key Code Example
using == is inefficient unity Code Example using == is inefficient unity Code Example
c   vs c Code Example c vs c Code Example
hovercraft in Unity Code Example hovercraft in Unity Code Example
largest element in array in c# Code Example largest element in array in c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12