简体   繁体   中英

Display a modal popup message before an aspx page starts loading

I have an .aspx page that calculates the Employees phones.
The data is read from Active Directory and it takes 5 minutes to display the listing.
I need to display a Modal popup message for the users to alert about the waiting time.
I followed various examples from Internet searches, some using for example

      $(document).ready(function() {alert ("it will take 5 minutes")});

or

windows.onload

but none works because they do not display in time, before the page starts to load.
All message examples I found do not display at all in my case or display after 5 minutes, in the same time with the PDF listing.

Please, advise! Thank You, Octavia

try the following

$(document).ready(function() 
showPopup(); // show pop up when page loads
});


$(window).load(function () {
  hidePopup() // hide popup when page loads completely
});

You can flush that header part of the page and then make the calculations. Also just place the alert on any script tag and not load it when the page is full ready. This is an idea:

<script>
   alert ("it will take 5 minutes");
</script>
<%
 // force to send what have, and that way is run the alert.
 Response.Flush(); 
 // now make the long running call
 Calculations();
 %>
...rest of html code that show the results...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM