PROJECT DESCRIPTION
This project demonstrated the showing and hiding of a RadAjaxLoadingPanel during the download of an exported file. I've implemented the idea explained here. The attached project is a sample website using the Northwind database to display records in a RadGrid. When you click any of the export buttons, the requestStart event of the ajax panel is triggered which causes a timestamp to get written to a HiddenField. A timer is also started in order to check for a cookie that is sent from the server once the export process is finished. On the server, the GridExporting event is handled at which point a cookie is written to the response stream with the timestamp previously sent from the client. Once the client confirms that the timestamp exists in the response's cookie, it clears the timer, hides the RadAjaxLoadingPanel and clears the cookie.

Cookies must be enabled on the client in order for this method to work. The RadGrid.ExportSettings.OpenInNewWindow must be set to true for this method to work.

In this example, I use the RadAjaxLoadingPanel, though you should be able to use any other loading graphic or jQuery plugin to accomplish the same thing. While a timestamp is used for identifying the request on the client, it shouldn't be relied upon to get the time it takes to generate a report, as the client doesn't check for the cookie until AFTER the file has finished downloading.

Maria Ilieva

Thank you for sharing your example and providing this great approach for showing LoadingPanel during export.
As a token of gratitude I have updated your telerik points.

Regards,
Maria Ilieva
the Telerik team

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.

Casey, you absolutely rock. This is an amazing solution and one I've seen people search for all over on the Internet. I have worked for hours trying to come up with a solution but had no idea that cookie's could also be written to the headers in addition to the file information.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.