How To Add Multiple Values In Session In Asp Net

[Solved] How To Add Multiple Values In Session In Asp Net | Vb - Code Explorer | yomemimo.com
Question : how to add multiple values in session in asp.net visual studio

Answered by : terrible-toad-irtsxb8zk5d0

// 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"]) : ""; }

Source : https://stackoverflow.com/questions/18439352/storing-and-retrieving-multiple-values-in-a-single-session | Last Update : Mon, 09 Aug 21

Answers related to how to add multiple values in session in asp net visual studio

Code Explorer Popular Question For Vb