I have tables with different column and row count as JSON on client side, e.g.:
[
["", "Kia", "Nissan", "Toyota", "Honda"],
["2008", "-5", "11", "12", "13"],
["2009", "20", "-11", "14", "13"],
["2010", "30", "15", "-12", "readOnly"]
]
I want to send this table to server via ajax and ASP.NET Web Api. What is the best way to do this?
I always get null as value when i want to post as text and receive it as [FromBody]string value. I can’t use a class because of different table sizes?
the answer was in the ajax code. I didn’t had the right data parameter. Right is:
then i can use e.g. JArray from JSON.NET to parse the value string.