Please refer this code
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$.ajax({
type: "POST",
url: "Default.aspx/GetArray",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
arr = response.d;
alert(response.d);
},
failure: function (response) {
alert(response.d);
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
C#
[System.Web.Services.WebMethod]
public static string GetArray()
{
string[][] str = new string[5][];
int i = 0;
int j = 0;
for (i = 0; i < 5; i++)
{
str[i] = new string[2];
for (int k = 0; k < 2; k++)
{
str[i][k] = (i * k).ToString();
}
}
JavaScriptSerializer js = new JavaScriptSerializer();
string json = (string)js.Serialize(str);
return json;
}
Namespace
using System.Web.Script.Serialization;
Screenshot