草庐IT

getFoodDetails

全部标签

javascript - 如何从 mvc Controller 获取列表以使用 jquery ajax 查看

我需要从mvcController获取列表以使用jqueryajax查看。我怎样才能做到这一点。这是我的代码。它的警报错误消息。在Controller中publicclassFoodController:Controller{[System.Web.Mvc.HttpPost]publicIListgetFoodDetails(intuserId){IListFoodList=newList();FoodList=FoodService.getFoodDetails(userId);return(FoodList);}}在View中functionGetFoodDetails(){deb