How to hide loading icon after getting a save open dialog box? RRS feed

  • Question

  • User34108037 posted

    Hi ,

    I have a ASP.NET website , one of the feature is download the content as text document. Its taking bit more time to download the document. so I am planning to display the loading icon until a download dialog box gets opened.

    When we use Response.write , the loading is not hiding after a dialog box gets opened.  Can anyone give me some idea to hide it after sending the response to client?

    I have tried the below alternate approach, saving the text file in one temp folder, then using anchor tag , assigning the path of that document to href and then invoking the click event of anchor tag. this way also no idea how to hide it ? also while opening the text file via anchor tag its opening in the browser itself as a inline. is there any way to open it using open , save dialog box.


    Wednesday, March 25, 2015 8:39 AM


  • User281315223 posted

    You could consider sending out a short Javascript snippet to handle hiding your element (based on it's ID) when your process is completed :

    // Build your script content
    string s = String.Format("document.getElementById('{0}').style.display = 'none';",YourControlToHide.ClientID);
    // Output your Script
    ClientScript.RegisterStartupScript(GetType(), "onload", s, true);

    This would find the element that you are trying to hide and hide it whenever the page was opened after adding this to the Response. Although, without seeing what your current code looks like, it could be difficult to determine exactly what syntax you should use.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 25, 2015 10:09 AM