Tag: paramarray

使用jQuery ajax / load提交数组参数

public ActionResult DoSomething(string[] arr, bool someBool, int someInt) { } 试图从jQuery调用上面的方法: var test = []; test.push(‘dog’); test.push(‘cat’); $container.load(‘MyController/DoSomething’, { ‘arr[]’: test, ‘someBool’: true, ‘someInt’: 1 }, function(response, status, xhr) { // … }); 数组参数为空,其他参数都很好。 我究竟做错了什么? Chrome开发者工具会将提交的表单数据显示为 arr%5B%5D%5B%5D:dog arr%5B%5D%5B%5D:cat someBool:true someInt:1 不知道那里发生了什么,但看起来不对我