public JsonResult GetAggingStockAjax() { pharmacy = new Pharmacy(_userName); List <MedicineView> medicineList = pharmacy.GetAggingStockAjax(); JavaScriptSerializer serializer = new JavaScriptSerializer(); var serealized = JsonConvert.SerializeObject(medicineList); return(this.Json(serealized, JsonRequestBehavior.AllowGet)); }