Pass a List<int> from javascript to controller
c#, javascript
Solution
I believe that you have to pass in something like this:
{"ids":[4,5,13]}
If you are using AJAX, then I remember that I had to set `traditional` to true (See the jquery ajax documentation) This was so that the parameters were able to be parsed properly.
Problem
I'm trying to pass a `List<int>` from my `View` to my `Controller`. I've tried multiple ways, with different parameters. No luck. I'm currently trying to pass `{[4,5,13]}` to a method with the parameter `List<int> ids`. What's the correct format to send a list or array of numbers?