I have created and filled various arrays using jquery. First time, trying to send JavaScript arrays to MVC controller.
Can I have an example how to do that? How can I send the arrays and other variables as well? On the controller side, how can I retrieve the data?
You'll probably want to use jQuery.ajax, with a dataType parameter of 'json'. You can send any JSON object. Possible example:
You can comma or pipe delimit your input and on the other end just parse it to keep things simple. Or if you want to do things the right object oriented way you could use the following code:
and on the controller end it would look like this
Hope this helps.