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?
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.
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly