我有一个这样的javascript数组:
不,你没有数组。javascript 中的数组必须具有从零开始的整数索引。你所拥有的是一个 javascript 对象。
所以有2个场景:
让我们首先介绍对象场景。所以你有一个对象:
public class Foo
{
    public string Bar { get; set; }
    public string Baz { get; set; }
}
然后你想将它传递给控制器动作:
[HttpPost]
public ActionResult Index(Foo foo)
{
    ...
}
以下是调用代码的样子:
var foo = {};
foo['bar'] = 'some bar';
foo['baz'] = 'some baz';
// or the equivalent:
// var foo = {};
// foo.bar = 'some bar';
// foo.baz = 'some baz';
// or the equivalent:
// var foo = { bar: 'some bar', baz: 'some baz' };
$.ajax({
    url: '@Url.Action("index", "startoption")',
    contentType: 'application/json',
    data: JSON.stringify({ foo: foo }),
    type: 'POST',
    timeout: 10000,
    success: function (result) {
        ....
    }
});
第二种情况,使用数组:
[HttpPost]
public ActionResult Index(Foo[] foos)
{
    ...
}
和调用代码:
var foos = [];
var foo1 = {};
foo1['bar'] = 'some bar 1';
foo1['baz'] = 'some baz 1';
foos.push(foo1);
var foo2 = {};
foo2['bar'] = 'some bar 2';
foo2['baz'] = 'some baz 2';
foos.push(foo2);
// or the equivalent:
// var foos = [ { bar: 'some bar 1', baz: 'some baz 1' }, 
//              { bar: 'some bar 2', baz: 'some baz 2' } ];
$.ajax({
    url: '@Url.Action("index", "startoption")',
    contentType: 'application/json',
    data: JSON.stringify({ foos: foos }),
    type: 'POST',
    timeout: 10000,
    success: function (result) {
        ....
    }
});