사전에있는 요소의 수를 jsonresult로 반환하려고 시도합니다.> 3.6k; 내 코드 :asp mvc 2 json 결과를 반환
$('#go').click(function() {
$("#content").empty().html('<img src="Content/loading.gif" style="top:100px;left:100px;"/>');
$.ajax({
type: 'POST',
url: '<%= Url.Action("LoadContent","Home") %>',
async: true,
data: {
block: $('input[name=block]:checked').attr('value'),
type: $('input[name=type]:checked').attr('value'),
begin: $('#begindate').attr('value') + " " + $('#begintime').attr('value'),
end: $('#enddate').attr('value') + " " + $('#endtime').attr('value')
},
dataType: 'json',
success: function (response) {
alert(response);
$.plot($("#content"), repsonse);
}
});
});
및 서버 측 :
public JsonResult LoadContent(string block,string type,string begin,string end) {
List<FinalResult> result = Core.LetThePartyBegin(DateTime.Parse(begin), DateTime.Parse(end), block);
Dictionary<DateTime, double> returnValue = new Dictionary<DateTime, double>();
result.ForEach(p =>
p.Result.ForEach(q => returnValue.Add(p.Datetime + new TimeSpan(0, 0, q.Number), q.W)));
return Json(returnValue);
}
때문에, JSON (ReturnValue를)은 3600 개 값을 포함하고 난 오류 500 내부 서버 오류 받고 있어요; Json (returnValue.Take (100))을 설정하면 작동합니다. jsonresult의 크기에 제약이 있습니까?
당신은 json의 start20 및 end 20 chracters를 반환 할 수 있습니까? 오류를 찾는 데 도움이 될 수 있습니다. –
방법 ?? 그 간단한 사전, 모르겠 무엇을 보여줄 수 – eba
오류의 세부 사항은 무엇입니까? – roryf