How can I detect when a file download has completed in ASP.NET?

前端 未结 6 1163
太阳男子
太阳男子 2021-01-31 21:23

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

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-31 22:16

    I handle the problem differently in Javascript, which might or might not work for you.

    • Create a hidden DIV element, with the message 'File is downloading...' rather than a pop-up box.
    • Show the div when the download starts
    • Once any other element on the forms is clicked, hide the div again..
    • You could also set a timer to hide the download message div after so amount of time...

    I figure once the user clicks on another element, she either already knows the download is done, or she is ready to do something else, so the message becomes irrelevant and can go away....

提交回复
热议问题