public static string GetQuotationDetails() { // HttpContext is used here to access non static variable Session inside static method. DataTable dtQuotationDetails = new DataTable(); decimal client_alias = Convert.ToDecimal(HttpContext.Current.Session["UserID"].ToString().Trim().Substring(0, 4)); dtQuotationDetails = VPCRMSBAL.GetQuotationDetails(Convert.ToDecimal(HttpContext.Current.Session["UserID"]), Convert.ToString(HttpContext.Current.Session["UserRole"])); String json = DataTableToJSONWithJavaScriptSerializer(dtQuotationDetails); return(json); }