I have a popup window that displays \"Please wait while your file is being downloaded\". This popup also executes the code below to start the file download. How can I close th
The way to do that is in your pop-up to call the server via AJAX polling for some response which would indicate the file was flushed.
Ex: right before sending the file, store sessionID+FileName in a DB or session or what have you.
On the client, in your popup, poll a web-service via AJAX - this could even be a WebMethod like Bool IsContentFlushed(string sessionID, string fileName);
After you do Response.Flush();
remove this sessionID+FileName from your store.
Call Response.Close()
instead of Response.End()
- the later is very brutal, and is usually over-kill.