First, I want to thank stack overflow before posting this. Here's the scenario. I want to Post Array [["a","b"],["c","d"]] in javascript. And Return data as the same [["a","b"],["c","d"]]. But I got these value - "[[\"a\",\"b\"],[\"c\",\"d\"]]"
Thanks in advance.
var arraylist = [["a","b"],["c","d"]];
$.ajax({
async: true,
type: "POST",
url: "/TestReciever.cshtml",
data: JSON.stringify(arraylist),
success: function (data) {
alert(data);
}
});
My TestReciever.cshtml code is :
string input;
using (var reader = new StreamReader(Request.InputStream)){
input = reader.ReadToEnd();
}
var j = Json.Encode(input);
Response.Write(j);