I have an HTML form that calls an ASP.NET page when a button is pressed using JavaScript's window.location. The ASP.NET page runs a process and prompts the user to save the results of the process to a text file on the user's computer.
Because the ouput of the ASP.NET page is a text file, the user never actually navigates away from the HTML form--that is the behavior I want. However, the process involved in generating the text file can take a minute or so. Hence, I'd like my HTML form to display a "Loading" message while the page is running and remove the message when the page is done running.
How can my HTML form know the state of the page it calls? In other words, how can I know when to remove the "Loading" message from the HTML form?
I ended up using a callback with an ASPX WebMethod to solve the issue. Since an ASPX WebMethod cannot save a text file to the browser, I write the file to disk and then return the URL of the file, prompting the user to save it.