my program does a long postback and I put some message onscreen that it’s “Working”. Now I want to query with AJAX in parallel to update that status (e.g. “20% done…”).
However it turned out that during postback no parallel calls to any webmethods are executed, these are delayed. So Javascript makes these calls (not so regularly) but they do not receive a reply before the whole PostBack ends (that renders the whole attempt of updating progress status unusable).
Is there a way to make parallel queries to IIS / ASP.NET application work?
I use ASP.NET 4.0 and Visual studio 2010 alongside with development server component
Thanks in advance!
You could take a look at using SignalR for this sort of operation. Check out http://www.signalr.net for more info.
This will allow you to start a long process and then have progress of this operation sent back to the client.
Scott Hanselman provides a working example of how to do this sort of thing on his blog. See here http://www.hanselman.com/blog/SolvingTheShakespeareMillionMonkeysProblemInRealtimeWithParallelismAndSignalR.aspx
Note though that his blog post was using an older version of SignalR so the code would require some API changes to work with the latest version.