I have a little problem. From webmethod returned two dimensional array.
My webmethod:
[WebMethod]
public static string[,] Test()
{
string[,] arry1 = new string[2, 2];
arry1[0, 0] = "test00";
arry1[0, 1] = "test01";
arry1[1, 0] = "test10";
arry1[1, 1] = "test11";
return arry1;
}
in my js code im using this way....
var arry1=new Array();
$.ajax({
url: "test.aspx/Test",
data: {},
cache: false,
async:false,
contentType: "application/json; charset=utf-8",
dataType: "json",
type: "GET",
success: function (data) {
arry1 = data.d;
},
error: function (response) {
alert(response);
}
});
alert(arry1[1,1]); //test01 why not test11?
How can i do this?
Edit.. Array
"test00" "test01";
"test10" "test11";
in asp.net
arry1[0, 0] = "test00";
arry1[0, 1] = "test01";
arry1[1, 0] = "test10";
arry1[1, 1] = "test11";
in javascript
arry1[0] // test00
arry1[1] // test01
arry1[2] // test10
arry1[3] // test11