asp.net - My ajax request times out (or is really slow) -


my first forray ajax webpages causing me problems.

my basic structure have table on page, want reload without refreshing entire page.

so on clicking button on page fires of this:

function refreshmissionsajax() {   //fade out old table.   $(clientid('missionsdisplay')).fadeout(500);    //request new value page (calls getincompletemissions() method in missionviewer.aspx.cs page)   $.ajax({       type: "post",       url: "missionviewer.aspx/getincompletemissions",       data: "{}",       contenttype: "application/json; charset=utf-8",       datatype: "json",       success: function (msg) {        $(clientid('missionsdisplay')).html(msg.d);       $(clientid('missionsdisplay')).fadein(500);     },     error: function (xhr, ajaxoptions, thrownerror) {          $(clientid('missionsdisplay')).html('an error occured while trying refresh page data.');         $(clientid('missionsdisplay')).fadein(500);     }   }); } 

and have in code bedind of aspx page:

[webmethod] public static string getincompletemissions() {     return gethtmltable(); } 

this method grabs data, , creates html table - nothing fancy.

when returned table small (a dozen rows or less) works charm. when gets larger, takes long long time.
@ 100 rows can take 5 minutes render table.
@ 1000 rows have left 30 minutes , nothing happen after fadeout.
(nb - loads on pageload, before ajax refresh used, not actual server side creation of table thats problem).

this first real attempt @ doing this, dont know if best way - pieced worked great when testing small datasets. now, not much.

any ideas how can make usable?

if possible, use wcf instead, should lot faster.

anyway, don't pass raw html back, have service return minimized data in json format use data in onsuccess event create table on fly jquery.

for example have service return json array 1000 items iterate array , add 1 row each item.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -