我真的需要你的帮助。 我的问题是我需要将一个arraylist转换为二角钱数组。 arraylist来自JSON.stringify并将其传递给由ArrayList处理的Webmethod // JSON文件
var noOfPstn = $("input[id$='txtPSTNOrderNum']").val();
var newvale = [];
var counter = 0;
for (var i = 0; i < noOfPstn; i++) {
$("table[id$='PSTNOrder'] tr:eq('1') td:eq(3) input:checkbox:checked").each(function (r) {
newvale.push([i], [$(this).val()]);
counter++;
});
}
// alert(newvale);
$.ajax({
type: "POST",
url: "NewPSTN.aspx/Sample",
data: "{ 'Values': " + JSON.stringify(newvale) + ", rows:" + noOfPstn + ", ticks:"+(counter)+" }",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) { }
});
//WebMethod
[WebMethod(EnableSession = true)]
[ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)]
public static void Sample(ArrayList Values,int rows, int ticks)
{
String[,] myValues = new String[rows,ticks];
}
由于