ASP.NET MVC2 JsonResult此请求已被阻止

我知道这个问题非常熟悉,但我无法解决。 这是我的控制器动作
public JsonResult AddToCart(int productId, int quantity = 1, int optionValue = 0)
{
  AjaxActionResponse res = new AjaxActionResponse();
  res.Result = ture;
  ......
  return Json(res, JsonRequestBehavior.AllowGet);
}
这是我的ajax请求
$.ajax({
    type: "GET",
    contentType: "application/json; charset=utf-8",
    url: "<%= Url.Action("AddToCart", "CartAjax") %>",
    data: ({'productId': productId, 'quantity': quantity, 'optionValue': optionValue}),
    dataType: "json",
    success: function (d) {
        if ($.isEmptyObject(d)) {
            return;
        }
        if (!d.Result) {
            alert(d.ErrorMessage[0].ErrorMessage);
        }
        else {
            $("#myCartBox").dialog("open");
        }
        return;
    }
});
当我运行ajax请求时会弹出已知错误   此请求已被阻止,因为   敏感信息可能是   向第三方网站披露   当在GET请求中使用它时。至   允许GET请求,设置   JsonRequestBehavior to AllowGet。 我试图使AddToCart动作[HttpPost]可以接受,但此时:参数从未到达方法并且从请求返回缺少参数错误(500 int.serv error) 我只能使用get方法运行,但此时请求已被阻止:) 我错过了什么吗?或者什么是MVC2 Ajax请求的正确方法。 WebForms非常成功地从JavaScript调用方法,但我不能在MVC上做到这一点。 任何的想法?     
已邀请:
您是否尝试使用此方法签名使用POST?
[HttpPost]
public ActionResult AddToCart(FormCollection form)
或者使用数据绑定:
public class CartItem {
    public int productId {get; set;}
    public int quantity {get; set;}
    public int optionValue {get; set;}
}
然后:
 public ActionResult AddToCart(CartItem c)
不幸的是我没有一个好的答案,但我已经用这种方式解决了一些我自己的问题(而不是弄清楚如何使用路由很好地传递参数)。     
我不确定这是你的根本问题,但你不应该将内容类型设置为text / html。这不是你发送的或MVC期望的。完全省略该参数,让jQuery将其设置为
application/x-www-form-urlencoded
,这是合适的。     

要回复问题请先登录注册