首页 新闻 会员 周边

导出数据至Excel进度条不能隐藏

0
悬赏园豆:5 [已关闭问题] 关闭于 2012-02-23 14:31

在导出数据至Excel时,有时数据会比较大,响应的时间会比较长,想做一个提示进度条,在点击导出数据按钮进,进度条显示出来,在数据导出完毕并成功弹出保存对话框时,进度条自动隐藏起来,但现在有个问题,点击导出时能显示进度条,在弹出文件保存对话框时,进度条不能隐藏,经调试是:

//查询数据代码(略).... 

Response.ContentType = "application/ms-excel";
Response.AppendHeader("Content-Disposition", "attachment;filename=info.xls");
Response.BinaryWrite(File.ReadAllBytes(strNowPath));
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>HideOverLayer();</script>");//隐藏进度条

执行这三条语句后,Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>HideOverLayer();</script>");这条语句执行之后在前台没有响应,求解决方法。。。

问题补充:

<style type="text/css">
body{ font-size:12px;}
.divExportProcess{
width: 208px;height: 20px;text-align: center;z-index: 999; background-color:White;
left: 50%;
top: 50%;
margin-left: -104px !important;
margin-top: -10px !important;
margin-top: 0px;
position: fixed !important;
position: absolute;
display: none;
}
</style>


<script type="text/javascript">
//show div
function ShowOverLayer() {
$("#overbgDiv").fadeIn();
$("#divExportProcess").fadeIn();
}
//closed div
function HideOverLayer() {
$("#overbgDiv").fadeOut();
$("#divExportProcess").fadeOut();
}
</script>
</head>
<body>
<form id="form1" runat="server">

<asp:Button ID="btnExport" runat="server" Text="导出数据" _disibledevent="btnExport_Click" _disibledevent="ShowOverLayer();" />

<div id="divExportProcess" class="divExportProcess"><img src="images/load_bar.gif" alt="loading" />数据导出中...</div>
</form>
</body>
</html>

--宁静以致远--的主页 --宁静以致远-- | 菜鸟二级 | 园豆:364
提问于:2012-02-20 15:04
< >
分享
所有回答(3)
0

确认注册的脚本已经下页面执行了吗?

小小刀 | 园豆:1991 (小虾三级) | 2012-02-20 22:07
0

HideOverLayer 这个方法也能晒出来吗?

keenweiwei | 园豆:215 (菜鸟二级) | 2012-02-21 13:15
0

....

--宁静以致远-- | 园豆:364 (菜鸟二级) | 2012-02-23 14:30
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册