I am facing a situation with my ASP.NET page where the server returns either a new page or a file for download after a request is made. I would like to display a "Processing..." message on the screen while the data is being retrieved from the server.
It's easy to call JavaScript when the user hits submit, but the page reload on Postback hides any "Processing..." indicators that are shown (such as DIVs popping up at the top of the page).
The main issue arises when the data returned by the server is a file instead of a web page. How can I detect when the server starts returning the data so that I can execute JavaScript to remove the "Processing" indicator? Is this even possible, especially when the response is of a different MIME type? In what scenarios would it be feasible?