How to get Ajax posted Array in my C# controller?

后端 未结 2 1538
孤城傲影
孤城傲影 2021-01-12 14:15

I work with ASP.NET-MVC. I try to post an array in ajax but I don\'t know how to get it in my controller. Here is my code :

Ajax

var lines = new Arra         


        
2条回答
  •  梦毁少年i
    2021-01-12 14:34

    First, try to change:

    data: { 'lines': lines }
    

    to

    data: { lines: lines },
    

    If it won't help, try to use json.stringify(lines)

提交回复
热议问题