简体   繁体   English

在开始加载aspx页面之前显示模式弹出消息

[英]Display a modal popup message before an aspx page starts loading

I have an .aspx page that calculates the Employees phones. 我有一个.aspx页,用于计算员工电话。
The data is read from Active Directory and it takes 5 minutes to display the listing. 数据是从Active Directory中读取的,需要5分钟才能显示列表。
I need to display a Modal popup message for the users to alert about the waiting time. 我需要显示一个Modal弹出消息,以提醒用户等待时间。
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. 我发现的所有消息示例在我的情况下根本不显示,或者5分钟后与PDF列表同时显示。

Please, advise! 请指教! Thank You, Octavia 谢谢,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...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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