【发布时间】:2011-10-14 07:59:16
【问题描述】:
我有一个使用 Webmatrix 编写的简单 Web 服务,它以 json 格式返回数据。我喜欢使用 ASP.NET MVC 3 使用该服务。我知道如何使用 WCF 执行此操作,但我们不会在此项目中使用 WCF。是否有类似于 ASP.NET MVC 中 jquery 的 getJson() 方法的东西,我只是传入 restful url,它返回数据并在回调中处理它?感谢您的帮助:-)
这是我的服务:
网址:
/services/GetAllItemsService
代码:
@{
var items = ItemsService.GetAllItems();
Json.Write(items, Response.Output);
}
【问题讨论】:
标签: asp.net asp.net-mvc web-services asp.net-mvc-3