public JsonResult GetProductCount(string ProductName) { int ProductCount = VendingService.GetProductCount(ProductName); return(Json(new { ProductCount = ProductCount }, JsonRequestBehavior.AllowGet)); }