how to pass the multiple values in session ASP.NET


Set Value in session
  // Set value in one UI in session  
       string empIdList = GetSelectedIDofGrid();  
       var paramObjects = new Dictionary<string, object>  
       {  
         {"paramEmployeeXmlstr", empIdList},  
         {"paramFactoryId", ddlFactoryName.SelectedValue}  
       };  
       Session["paramPayroll_RPT014_Staff"] = paramObjects;  

Get value from session

 // Get Value in another UI From session  
     private string _paramEmployeeXmlstr = String.Empty;  
     private string _paramFactoryId = String.Empty;  
     var paramObjects = Session["paramPayroll_RPT014_Staff"] as Dictionary<string, object>;  
       if (paramObjects != null)  
       {  
         _paramEmployeeXmlstr = (string)paramObjects["paramEmployeeXmlstr"];  
         _paramFactoryId = (string)paramObjects["paramFactoryId"];  
       }  


Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report