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

C# print file on LAN Printer

If you want to print any file on network printer then you can try with this code block // Change Default Printer System.Ma...