03 August 2004

Asynchronous call for Web Forms

Call back function is useful in catch asynchronous result arrival event. It works fine on those known sockets/connection such like WIN FORM, Web Services. However, it is not applicable for Web form. There is simply no easy, reliable way for server to notify client browser.

WaitOne, WaitAny and WaitAll provides a mechanism allowing a Web form to multi-task background processes and collect result after they have completed. Read this Optimizing Web service calls from Web Forms

This pattern is not that helpful when comes to UI, however.
Image there is a long run process, I want to display a progress bar one the call has been made. Then a few ten seconds later, I want to collect the result and update the UI accordingly- just show the progress bar if the result is not ready. You have to use script to refresh browser.

(5/03/2005)Just found this discussion that suggests implementing System.Web.IHttpAsyncHandler interface in the page behind class which sloves the problem.

No comments: