【发布时间】:2012-10-30 10:03:12
【问题描述】:
我有这个问题。
我的功能是这样的
$.ajax({
type: "POST",
url: "/controller/CreateList",
contentType: "application/json; charset=utf-8",
traditional: true,
data: JSON.stringify(myvar),
success: function (returnArray) {
}
.....
在我的控制器中我有这个动作:
public int[] CreateList(List<ERoleCommission> erolecommission){
List<int> intList= new List<int>();
...//populate the List
return intList.ToArray();
}
通过调试,我看到 intList 填充了正确的值,所以这不是 c# 错误, 从控制器调用此操作后,调试返回 js 函数和 returnArray = "System.Int32[]",它只包含类型。 为什么? 谢谢
【问题讨论】:
标签: c# javascript jquery ajax asp.net-mvc-4