Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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

PREVIOUS NEXT
Code Example
Csharp :: Runtime.getRuntime().addShutdownHook(printingHook); c# 
Csharp :: c# psobject get value 
Csharp :: unity having virtual start 
Csharp :: Avoid auto-filling persian time picker 
Csharp :: c# remove 0 from string 
Csharp :: c# is not 
Csharp :: .net entities query multiple join condition 
Csharp :: Read from textfile and fill in textbox 
Csharp :: netlifycms disable preview 
Csharp :: visual studio import excel get document created date 
Csharp :: how to handle list properties in c# of string type 
Csharp :: remove tag anchor and inside tag from html raw text c# 
Csharp :: c# lernen kostenlos 
Csharp :: c# Search specified string inside textbox 
Csharp :: unity get layermask 
Csharp :: c# reflection 
Csharp :: list dictionary c# 
Csharp :: c# loop back 
Csharp :: c# literals 
Csharp :: C# get the last item of the array 
Csharp :: unity getcomponent transform.position 
Csharp :: c# convert ad objectguid to string 
Csharp :: c# an object on upper level cannot be added to an object 
Html :: open page with html 
Html :: how to open link in new tab 
Html :: tag for tel 
Html :: upload only image input tag 
Html :: new tab in html 
Html :: base64 image html example 
Html :: html white space on both sides of the page 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =