Asp.net mvc mvc2迁移问题

Asp.net mvc mvc2迁移问题,asp.net-mvc,Asp.net Mvc,我将mvc1项目迁移到mvc2 我的jquery json结果函数不再工作。你知道吗 aspx $.getJSON('Customer/GetWarningList/0', function(jsonResult) { $.each(jsonResult, function(i, val) { $('#LastUpdates').prepend(jsonResult[i].Url);

我将mvc1项目迁移到mvc2

我的jquery json结果函数不再工作。你知道吗

aspx

$.getJSON('Customer/GetWarningList/0', function(jsonResult) {
                    $.each(jsonResult, function(i, val) {
                        $('#LastUpdates').prepend(jsonResult[i].Url);
                    });

                });
控制器

public JsonResult GetWarningList(string id)
        {
            List<WarningList> OldBck = new List<WarningList>();

            return this.Json(OldBck);

        }
公共JsonResult GetWarningList(字符串id) { List OldBck=新列表(); 返回this.Json(OldBck); }
MVC2中对JsonResult进行了更改,因此它将不再使用HTTP GET来避免Json劫持

所以你有两个选择

a. return your results via HTTP Post 

or 

b. the JsonRequestBehavior property to JsonRequestBehavior.AllowGet
有一篇关于如何修改的有趣文章


MVC2中对JsonResult进行了更改,因此它将不再使用HTTP GET来避免Json劫持

所以你有两个选择

a. return your results via HTTP Post 

or 

b. the JsonRequestBehavior property to JsonRequestBehavior.AllowGet
有一篇关于如何修改的有趣文章


你有例外吗?你在萤火虫/小提琴手身上看到了什么?更多信息请…你有例外吗?你在萤火虫/小提琴手身上看到了什么?更多信息请。。。