Jul 12, 2012, 5:39 AM
AjaxMethod - is it Asynchronous
Hi,
I have a piece of code that validates my grid rows and makes a call to an AjaxMethod for every grid row
Any hints on making this truly Asynchronous....??
Thanks for anyone who can help???
I have a piece of code that validates my grid rows and makes a call to an AjaxMethod for every grid row
this.store.each(function(rec,i){
var gridRow=that.grid.getView().getRow(i);
$('td span.statusImage', $(gridRow)).attr('class', 'statusImage loading');
Coolite.AjaxMethods.TimesheetEdit.AddTimesheet(Ext.encode(rec.data),true);
});
[AjaxMethod]
public static void AddTimesheet(string record, bool validate)
{
Thread.Sleep(5000);
}
If I put a Thread.Sleep(5000) inside the AjaxMethod and nothing else and start up Firebug. I notice that initially that a post is made for each grid row however each row returns 5 seconds after the previous i.e. 5 rows will take 25 seconds? This suggests that the AJAX methods are called asynchronously but perhaps my ASP.net is waiting for the previous call to finish?Any hints on making this truly Asynchronous....??
Thanks for anyone who can help???