【发布时间】:2016-01-29 06:51:17
【问题描述】:
我在尝试使用 jQuery getJSON 函数时遇到了一个相当特殊的问题。
我尝试通过制作这样的对象来发送我的参数:
var args = {
from: "",
to: "",
customerId: "52"
articles: ['12312', '21521']
};
然后调用getJSON函数:
$.getJSON('/Statistics/TimeGraph', args, function (response) {
//Fill graph.
});
这就是问题的开始。我在控制器上收到了请求,但没有填充articles(其他参数是)。
控制器动作:
public JsonResult TimeGraph(DateTime? from, DateTime? to, int? customerId, string[] articles)
{
return Json("", JsonRequestBehavior.AllowGet);
}
不能在这样的对象中发送数组吗?还是我缺少什么?
【问题讨论】:
标签: c# jquery json asp.net-mvc