我需要在页面加载时显示“加载”指示器。我正在从页面后面的代码中的其他服务器获取数据并绑定(bind) ListView 。我没有使用更新面板,也没有通过ajax获取数据。那么,当页面加载时间很长时,如何显示“正在加载”指示器。
提前致谢。
最佳答案
您创建一个包含 div,其中心有一个加载 gif。
当您启动 ajax 请求时,您会显示它(例如使用 jquery),当 ajax 请求完成时,您会隐藏它。
它可以/应该看起来像这样:
显示加载指示器的代码:
$('#busy-holder').show();
div:
<div id="busy-holder" style="display: none">
<div id="busy">
</div>
</div>
CSS:
#busy
{
position: fixed;
left: 50%;
top: 50%;
background: transparent url("loader.gif");
z-index: 1000;
height: 66px;
width: 66px;
}
#busy-holder
{
height:100%;
width:100%;
position:fixed;
left:0;
top:0;
display: none;
filter: alpha(opacity=30);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=30);
opacity:0.3;
-moz-opacity: 0.30;
z-index: 1000;
}
关于c# - 如何在 ASP.net 中显示加载页面指示器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10548385/