asp.net - Displying data in gridview using jQuery ajax call is too slow -


i have gridview , button. on button click binding data gridview using jquery ajax call. below code.

i followed code explained in link http://www.aspdotnet-suresh.com/2012/03/bind-data-to-gridview-with-jquery-or.html

  1. i fetching data datatable database
  2. taking datatable data list object looping each row of datatable
  3. returning list .cs static webmethod , returning same list
  4. i .cs webmethod on button click through jquery ajax , appending list data gridview shown below.

code:

$.ajax({     type: "post",     contenttype: "application/json; charset=utf-8",     url: "manualreconjs.aspx/getremarkhistory",     data: json.stringify({         sappid: sappid,         stempl: stempl,         suserid: suserid,         ssrno: ssrno     }),     cache: false,     datatype: "json",     beforesend: function() {         $("#imgmodalremarks").show();     },     success: function(result) {         $('#gvremarkshistory').empty();          var tempdatahtml = "";         if (result.d.length > 0) {             (var = 0; < result.d.length; i++) {                 tempdatahtml = "";                 if (i == 0) {                     var items = result.d[i].tostring().split(',');                     tempdatahtml += "<tr>";                     (var j = 0; j < items.length; j++) {                         tempdatahtml += "<th>" + items[j] + "</th>";                     }                     tempdatahtml += "</tr>";                 } else {                     var items = result.d[i].tostring().split(',');                     tempdatahtml += "<tr>";                     (var j = 0; j < items.length; j++) {                         tempdatahtml += "<td>" + items[j] + "</td>";                     }                     tempdatahtml += "</tr>";                 }                  $("#gvremarkshistory").append(tempdatahtml);             }         } else {             $("#imgmodalremarks").hide();             alert('remarks history not found.');         }         $("#imgmodalremarks").hide();     },     error: function(result) {         var err = $(result.responsetext).filter('title').text();         alert("message: " + err);         $("#imgmodalremarks").hide();     } }); return false; 

my requirement display remarks in gridview. above code working fine , fast when remarks data less. having problem on when data in large amount. suppose have more 10000 records , have implemented paging logic (1000 per page) also. while page load displaying first 1000 remarks , on next click displaying 1000 remarks ... each , every next/prev click data fetching very slow , in each click page gets hanged till process complete.

please suggest me best ways fetch , display data on grid. how can make fast? fetching data database fast(in milliseconds) not possible bind datatable gridview directly?

gridview slow when load large amount of data on page. gridview option small data. if want show large amount of data should use html table. contain more data , fast loading page rather gridview. hope understand can say.


Comments