Submit array param with jQuery ajax/load

后端 未结 4 1780
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-13 10:05

public ActionResult DoSomething(string[] arr, bool someBool, int someInt) { }

trying to call the above method from jQuery:

var test = [];
te         


        
4条回答
  •  迷失自我
    2021-02-13 10:36

    Just remove []

    { 'arr': test, 'someBool': true, 'someInt': 1 },
    

    Posted values (checking with Firebug).

    arr[]       dog
    arr[]       cat
    someBool    true
    someInt     1
    
    • Example on jsFiddle

提交回复
热议问题