Multiple calls to different page methods in same web page are not running in parallel (JQuery/Ajax/A
- by Tony_Henrich
I have several page methods defined in the code behind of an aspx page. I have several JS calls (see example below), one after the other, in the ready() method of JQuery to call these page methods. I noticed the javascript calls run asynchronously but the .NET page methods do not run in parallel. Page method 1 finishes first before page method 2 runs.
Is there a way to get all the page methods to run all at the same time? My workaround is to put each method in its own aspx page or use iframes but I am looking for better solutions.
$.ajax({
type: "POST",
url: (page/methodname),
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
....
}
}
});