Hello!
I've got a simple C# ASP.NET app that generates an Excel file and sends it to the browser using the Response.WriteFile() function.
I would like to disable the submit button once it has been clicked and display a message on the screen to wait a few minutes, since some of the files can take a while to generate. This works great, but I cannot figure out how to re-activate the button, or even refresh the page, after the file is done downloading. The page stays in a disabled, "Please wait..." state even when it's finished.
I thought a synchronous AJAX call with extra javascript commands afterward would work, but although the file does get generated, it's never sent to the browser. I've also tried using an iframe control, but can't find any way to reliably know when a new file is finished loading inside it.
Thanks in advance to anyone who can help!
UPDATE: I found a possible solution at http://code.msdn.microsoft.com/AjaxFileDownload that works great for downloading files that already exist, but when I call a page that generates the file and finishes with Response.End(), the "Finished Downloading" event never fires.