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

Display a modal popup message before an aspx page starts loading

本文关键字:模式 显示 消息 aspx 开始 加载      更新时间:2023-09-26

我有一个.aspx页面,用于计算员工的电话。
数据是从活动目录中读取的,需要 5 分钟才能显示列表。
我需要显示一条模式弹出消息,以便用户提醒等待时间。
我遵循了互联网搜索中的各种示例,其中一些例如使用

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

windows.onload

但是没有一个有效,因为它们在页面开始加载之前没有及时显示。
我找到的所有消息示例在我的情况下根本不显示,或者在 5 分钟后与 PDF 列表同时显示。

请指教! 谢谢你,奥克塔维亚

请尝试以下操作

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

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

您可以刷新页面的标题部分,然后进行计算。此外,只需将警报放在任何脚本标记上,而不是在页面完全准备就绪时加载它。这是一个想法:

<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...