Here is my js code on the page:
var data = [
["Benz", "Kia", "Nissan", "Toyota", "Honda"],
["2008", 10, 11, 12, 13],
["2009", 20, 11, 14, 13],
["2010", 30, 15, 12, 13]
];
$.ajax({
url: "/Home/SaveData",
type: "POST",
contentType: 'application/json',
data:JSON.stringify({ data: data }),,
dataType: 'json',
});
Here is my mvc action given below:
[HttpPost]
public string save(string[][] data)
Null value was posted, However, I tried to use List< string>
instead of string[][]
, the hold string of array collected as an item of the list (not a row to a list item).
How to bind this 2D array at server side?
>** instead.