Summary
This chapter is devoted to the topic of finding ways to present users with status information while a complex or lengthy process is taking place. This chapter looks at two different approaches: displaying a simple "please wait" message or animated GIF image and implementing the server-side process as a series of staged individual operations.
The first of these techniques doesn't really provide feedback because the user is just looking at what is effectively the shadow of the last page that the browser displayed. Underneath, it is waiting for a response from the server. However, displaying a message indicating that the user should wait gives the impression that something really is happening. And removing from the page any buttons or other controls that the user might be tempted to play with prevents the page from being resubmitted and upsetting your server-side code.
This chapter also shows how you can improve on the simple "please wait" text message by using an animated GIF imagein this case, a progress bar. By choosing an image that progresses at a rate matching the average page load time, you can make it look as though your server is working flat out to satisfy their request.
Displaying a progress bar image should be a simple task, but as you discovered, there are issues that arise. (And they say that Web development is child's play!) You ended up having to find two different solutions: one for Internet Explorer and another for other types of browsers. This gave you the opportunity to look into how you can load pages in the background by using the XMLHTTP object that is part of the standard installation of Internet Explorer 5 and above.
Finally, this chapter looks at a process that uses the XMLHTTP object to implement a staged execution and page loading process. This is a really neat solution for an application that has to perform separate tasks to build up the final page that is returned to the client. And, of all the techniques examined in this chapter, this one alone has the advantage of providing accurate real-time status information as the server processes proceed.
If you decide to follow the asynchronous page-loading route, you might like to look at an implementation designed for the .NET Framework by Microsoft, called the Asynchronous Invocation Application Block for .NET. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/paiblock.asp for more details.