Access the answers to your technology questions today.
Subscribe Now
30-day free trial. Register in 60 seconds.
What Makes Experts Exchange Unique?
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
Subscribe Now
30-day free trial. Register in 60 seconds.
Join the Community
Give a Little. Get a Lot.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Join the Community
by: DropZonePosted on 2009-01-11 at 05:44:24ID: 23348221
A very simple, yet effective way to do this, is to execute some JavaScript on the page to display the animation the moment the user clicks on the submit button. The animation image should either be already in the page, hidden; or dynamically injected into the content flow by the script. In any case, the script will enable the animation prior to performing the submission.
Then you make sure that OutputBuffering is enabled on your server, which will cause your application to not render any output until it is done processing the page. The end result is that the browser will persist the old page with the animation while waiting for the new page to finish processing and start rendering.
No round trip is necessary.
An alternative is to use AJAX calls to perform the processing and retrieve the results, instead of using a form submission (Post-Back). The principle is the same: you intercept the button click on the client-side and call a function to perform the processing. This function in turn will enable the heretofore hidden animation, and make a server call to process the data. When the process is complete, your AJAX call-back function will be executed, where you can render the results. During the processing, the user is presented with the animation.
I have used both methods and they work quite effectively.
-dZ.