0

Possible Duplicate:
ASP.NET Server does not process pages asynchronously

There is a question regarding Asynchronous response to an Ajax request.

I’m working on a web application to enable some simple image processing actions for user, using ASP.Net + Ajax. As most of image processing actions takes a while to accomplish, we’d like to utilize user to send the request to the server through Ajax, and get the partial response immediately, while the server is processing and to send completed response in a later time (i.e. 10/20 seconds later for instance).

This way, I suppose the server should be able to push the late response (which obtained 10/20 seconds later) to the client.

Is there any idea how to realize such interaction?

Community
  • 1
  • 1
sam
  • 1
  • 1

2 Answers2

0

The closest thing you'll get is JSONP, which can be used with jQuery.

Echilon
  • 10,064
  • 33
  • 131
  • 217
0

like:

 $.ajax({
     type: 'GET',
     url: 'http://api.stackoverflow.com/1.1/tags/ravendb/wikis',
     dataType: 'jsonp',
     jsonpCallback: 'jsonCallback',
     jsonp: 'jsonp'
     async: true,
     success: function (data) {
         if (data.tag_wikis.length > 0) {
             alert(data.tag_wikis[0].wiki_excerpt);
         }
     },
 });