首页 新闻 赞助 找找看

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

0
[已关闭问题] 关闭于 2012-03-02 22: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-23 14:27
< >
分享
所有回答(1)
0

高手where?

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