Getting error (500 internal server) while fetching JSON, when more than 1000 rows is returned from database?


1. I want to fetch some data from DB (parameters false ,true,some id(e.g.: 30245)) Following is function written in controller :

[HttpPost]
  public ActionResult GetISBNRequestList(bool isRecursive, bool isCompleted, int ClientRequestID)
        {
            List<CrawlerRequest> ISBNList = new List<CrawlerRequest>();
            ISBNList = _CrawlerRequestFacade.GetCrawlerCompleteRequestList(_loginVM.Id, 
            isRecursive, isCompleted, ClientRequestID);
            return Json(ISBNList);
        }

2.In Js: I am populating data to bootstrap pop-up: but an error occurs if records are more than 1000, function call goes to error block in js :

  function GetISBNRequest(obj, isRecursive, isCompleted)
{
    var clientRequestID = $(obj).data("id");
    if (clientRequestID > 0) {
        $.ajax({
            url: '/CrawlerRequest/GetISBNRequestList/',
            data: JSON.stringify({isRecursive: isRecursive,isCompleted: isCompleted,ClientRequestID: clientRequestID}),
            dataType: "json",
            type: "POST",
            contentType: "application/json; charset=utf-8",
            success: function (data, textStatus, XMLHttpRequest) {
             $.each(data, function (n, item) {
                    // fetching data like item.columnname and appending into table  
                });
            },
            error: function (xhr, ajaxOptions, thrownError) {
                console.log(xhr.error().statusText);
            }
        });
    }
}

 Please give me suggestions for this or else should I try to display view in the bootstrap popup?


Asked by:- Snehal
0
: 274 At:- 3/3/2018 3:34:33 PM
asp.net mvc jquery

did @vikas's answer worked? 0
By : jon - at :- 3/14/2018 7:47:50 PM





1 Answers
profileImage Answered by:- vikas_jk

500 internal error, means your C# code is not returning correct data, or maybe there is some error while executing C# code.

Try Debugging your C# code and use Firefox/Firebug or Chrome console, to look at the actual response you are getting from the server.

2
At:- 3/3/2018 7:03:34 PM





Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use

Subscribe Now

Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly