【发布时间】:2012-01-07 01:16:17
【问题描述】:
我在 JS 中有一个字符串数组。所有成员实际上都是数字。
我的控制器有一个 int[] 参数。
我从 jquery 发送它:
$.ajax({url: someUrl, data: {ids : JSON.stringify(id_array) }, ...)
我使用
收到它public ActionResult MyAction(int[] ids) { ...
参数没有填满,我查过,Request.Form["ids"] 包含“[\"25\",\"26\"]"”,JSON 数组的字符串表示。
有没有办法自动无需进行大量的 int 解析?
【问题讨论】:
标签: jquery ajax arrays json asp.net-mvc-3