I got it:
in my javascript I have:
function Save() {
var list = [["1","2","3"],["4","5","6"],["34","88","898"]];
var jsonText = JSON.stringify({ list: list });
$.ajax({
type: "POST",
url: "http://localhost/TemplateWebService/TemplateWebService/Service.asmx/SaveSampleTemplate",
data: jsonText,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
//var arrSamples = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
alert("success!");
alert(response.d);
},
failure: function(msg) {
alert("fail");
}
});
}
then in my web service (asp.net web service):
[WebMethod()]
public string SaveSampleTemplate(string[][] list)
{
List<string[]> mylist = list.ToList();
// return list.Count.ToString();
string str = "";
for (int i = 0; i < mylist.Count; i++)
{
string[] m = mylist[i];
for (int j = 0; j < m.Length; j++)
{
str += m[j] + " ";
}
}
return str;
// return list.Length.ToString();
}