ASP.NET JSONのデータ長
こんな感じでJSONデータを取得していたのですが
$.ajax({
url: "hoge.asmx/GetData",
data: JSON.stringify(params),
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (result) {
endGridRequest("dtbl");
var grdData = $("#tbl")[0];
grdData.addJSONData(result.d);
},
error: function (result) {
alert(result.responseText);
}
});
テスト環境では問題なく動作。
本番環境で「文字列の長さがmaxJsonLengthプロパティで設定されている値を超えています」とエラーが出て動かなくなってしまった。
Web.ConfigにmaxJsonLengthを設定して動作するようになりました。
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="999999999" />
</webServices>
</scripting>
</system.web.extensions>
最近のコメント