Sunday, May 11, 2014

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


Ensure that this project has Microsoft.Bcl.Build installed and packages.config is located next to the project file

In my Xamarin form application their was dependency Restclient on Microsoft.Bcl.Build Microsoft.Bcl. i just remove all using nuget and ...