UpdateProgress正在使用下载文件选项,但下载后仍在旋转. [英] UpdateProgress is working with download file option but still spinning after download also..

查看:93
本文介绍了UpdateProgress正在使用下载文件选项,但下载后仍在旋转.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UpdateProgress无法使用下载文件.请参见下面的代码,在此代码中,我已使用updatepanel和updateprogress.

在btnGenerateReport上,单击我正在下载Excel文件".在下载"选项上,如果我单击打开",保存"或取消"按钮,则弹出,但更新进度仍在旋转.在这里,我使用了发回触发器,因为我正在使用文件上载COntrol并显示来自javascript的更新进度.
请帮助我解决此问题,因为我希望在打开/取消/保存excel后更新进度被隐藏.我也曾尝试隐藏具有更新进度但不起作用的Div.
我没有出现任何错误,但是我已经在< progresstemplate>中添加了等待图像".仍然显示,并且在从下载中下载/取消/保存文件后,消失不消失.

UpdateProgress not working with download file. Please see below code, in this code i have used updatepanel ans updateprogress.

on btnGenerateReport click i am downloading a excel file. On the Download option Pop up if i click on Open,Save Or Cancel Button then also still the Update Progress is spinning.Here i had Used Post back trigger because i m using File Upload COntrol and Showing the Update Progress from javascript.
Please help me to resolve this issue as i want that after Opening/Cancelling /Saving the excel the Update progress get hide.I had also tried to Hide the Div in which the Update Progress is there but it is also not working.
I m Not getting any error but the "Waiting image", i had put in the <progresstemplate> is still showing and not getting disappear after downloading/Cancelling/Saving the File from the Download Pop up appears.

<asp:ScriptManager ID="ScriptManager1" runat="server" enablepagemethods="true" />    
 <script type="text/javascript">
        var updateProgress = null;

        function postbackButtonClick() {
            updateProgress = $find("<%= UpdateProgress.ClientID %>");
            window.setTimeout("updateProgress.set_visible(true)", updateProgress.get_displayAfter());
            return true;
        }
</script>
 <asp:UpdatePanel ID="UpdPanel" runat="server" UpdateMode="Conditional">
 <ContentTemplate> 
<div id="EQDUMPUpload"  runat="server" align="center" 
        style="position: relative; z-index: inherit; width: auto; height: auto; top: auto; right: auto; bottom: auto; left: auto">
<table >
<tr>
<td>
    <asp:Label ID="Label1" runat="server" 
        Text="Step 1 : Upload the ReportEQ File" Font-Bold="True" ForeColor="Blue"></asp:Label>
    </td>
<td>
    <asp:FileUpload ID="EQDumpUploader" runat="server" />
</td>
</tr>
<tr>
<td></td>
<td>
</td>
<td></td>
</tr>
</table>
</div>
<div id="HRISUpload"  runat="server" align="center" 
        style="position: relative; z-index: inherit; width: auto; height: auto; top: auto; right: auto; bottom: auto; left: auto">
<table >
<tr>
<td><asp:Label ID="Label2" runat="server" 
        Text="Step 2 : Upload the HRISInfo File" Font-Bold="True" ForeColor="Blue"></asp:Label></td>
<td>
   <asp:FileUpload ID="HrisUploader" runat="server" />
</td>
</tr>
<tr>
<td></td>
<td>
</td>
<td></td>

</tr>
</table>
</div>
<div id="GenerateReportDiv"  runat="server" align="center"    style="position: relative; z-index: inherit; width: auto; height: auto; top: auto; right: auto; bottom: auto; left: auto">
<table>
<tr>
<td>    
    <asp:Button ID="btnGenerateReport" runat="server" Text="Generate Allocation Report" 
        onclick="btnGenerateReport_Click"  Font-Names="Verdana" Font-Size="10pt" 
        UseSubmitBehavior="True" OnClientClick="return postbackButtonClick();" ClientIDMode="Static"  />        
</td></tr>
</table>
</div>
<div id="divConfirmation"  runat="server"  align="center" style="position: relative; z-index: inherit; width: 930px; height: auto; top: 0px; right: 0px; bottom: 0px; left: 0px">
        <table>
        <tr>
        <td>
<asp:Label ID="lblCnfrm" runat="server" Text="Label" Font-Bold="True" ForeColor="Red" Font-Names="Verdana" Font-Size="Small" ></asp:Label>
        </td>
        </tr>
        <tr>
        <td>
<asp:Label ID="lblHRISCnfrm" runat="server" Text="Label" Font-Bold="True" ForeColor="Red" Font-Names="Verdana" Font-Size="Small" ></asp:Label>
        </td>
        </tr>
        <tr>
        <td>
<asp:Label ID="lblAllocationCnfrm" runat="server" Text="Label" Font-Bold="True" ForeColor="Red" Font-Names="Verdana" Font-Size="Small" ></asp:Label>
        </td>
        </tr>
        </table>
        </div>
 </ContentTemplate>
 
<Triggers>
<asp:PostBackTrigger ControlID="btnGenerateReport"  />
</Triggers>
</asp:UpdatePanel>
<div id="divUpdateProgress"  runat="server">
 <asp:Updateprogress id="UpdateProgress" runat="server" 
        associatedupdatepanelid="UpdPanel">
                    <Progresstemplate>
                    <div id="Layer1"  style="removed:absolute; z-index:1; removed 50%;removed 50%;">
                        <img src="Images/waiting.gif" alt="" />
                        </div>              
                    </Progresstemplate>
            </asp:Updateprogress> 
            </div>   
</asp:Content>

推荐答案

find(<%= UpdateProgress.ClientID%>"); window.setTimeout("updateProgress.set_visible(true)",updateProgress.get_displayAfter()); 返回true; } </script> < asp:UpdatePanel ID ="UpdPanel" runat ="server" UpdateMode ="Conditional"> < ContentTemplate> < div id ="EQDUMPUpload" runat =服务器" align ="center" style ="position:relative; z-index:Inherit; width:auto; height:auto; top:auto; right:auto; bottom:auto; left:auto"> <表> < tr> < td> < asp:标签ID ="Label1" runat =服务器" Text ="Step 1:上载ReportEQ文件" Font-Bold ="True" ForeColor ="Blue"></asp:Label> </td> < td> < asp:FileUpload ID ="EQDumpUploader" runat ="server"/> </td> </tr> < tr> < td></td> < td> </td> < td></td> </tr> </table> </div> < div id ="HRISUpload" runat =服务器" align ="center" style ="position:relative; z-index:Inherit; width:auto; height:auto; top:auto; right:auto; bottom:auto; left:auto"> <表> < tr> < td>< asp:标签ID ="Label2" runat ="server" Text ="Step 2:上传HRISInfo文件" Font-Bold ="True" ForeColor ="Blue"></asp:Label></td> < td> < asp:FileUpload ID ="HrisUploader" runat ="server"/> </td> </tr> < tr> < td></td> < td> </td> < td></td> </tr> </table> </div> < div id ="GenerateReportDiv" runat =服务器" align ="center" style ="position:相对; z-index:继承; width:自动; height:自动; top:自动; right:自动; bottom:自动;左:自动> < table> < tr> < td> < asp:按钮ID ="btnGenerateReport" runat =服务器" Text =生成分配报告" onclick ="btnGenerateReport_Click"字体名称="Verdana"字体大小="10pt" UseSubmitBehavior ="True" OnClientClick ="return postbackButtonClick();" ClientIDMode ="Static"/> </td></tr> </table> </div> < div id ="divConfirmation" runat ="server" align ="center" style ="position:相对; z-index:继承;宽度:930px;高度:自动;顶部:0px;右侧:0px;底部:0px ; left:0px> < table> < tr> < td> < asp:标签ID ="lblCnfrm" runat =服务器" Text =标签" Font-Bold ="True" ForeColor ="Red"字体名称="Verdana" Font-Size ="Small">< /asp:标签> </td> </tr> < tr> < td> < asp:Label ID ="lblHRISCnfrm" runat ="server" Text ="Label" Font-Bold ="True" ForeColor ="Red"字体名称="Verdana" Font-Size ="Small">< /asp:标签> </td> </tr> < tr> < td> < asp:Label ID ="lblAllocationCnfrm" runat ="server" Text ="Label" Font-Bold ="True" ForeColor ="Red"字体名称="Verdana" Font-Size ="Small">< /asp:标签> </td> </tr> </table> </div> </ContentTemplate> < Triggers> < asp:PostBackTrigger ControlID ="btnGenerateReport"/> </Triggers> </asp:UpdatePanel> < div id ="divUpdateProgress" runat ="server"> < asp:Updateprogress id ="UpdateProgress" runat ="server" relatedupdatepanelid ="UpdPanel"> <进度模板> < div id ="Layer1" style ="removed:absolute; z-index:1;已移除50%;已移除50%;"> < img src ="Images/waiting.gif" alt ="/> </div> </Progresstemplate> </asp:Updateprogress> </div> </asp:Content>
find("<%= UpdateProgress.ClientID %>"); window.setTimeout("updateProgress.set_visible(true)", updateProgress.get_displayAfter()); return true; } </script> <asp:UpdatePanel ID="UpdPanel" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div id="EQDUMPUpload" runat="server" align="center" style="position: relative; z-index: inherit; width: auto; height: auto; top: auto; right: auto; bottom: auto; left: auto"> <table > <tr> <td> <asp:Label ID="Label1" runat="server" Text="Step 1 : Upload the ReportEQ File" Font-Bold="True" ForeColor="Blue"></asp:Label> </td> <td> <asp:FileUpload ID="EQDumpUploader" runat="server" /> </td> </tr> <tr> <td></td> <td> </td> <td></td> </tr> </table> </div> <div id="HRISUpload" runat="server" align="center" style="position: relative; z-index: inherit; width: auto; height: auto; top: auto; right: auto; bottom: auto; left: auto"> <table > <tr> <td><asp:Label ID="Label2" runat="server" Text="Step 2 : Upload the HRISInfo File" Font-Bold="True" ForeColor="Blue"></asp:Label></td> <td> <asp:FileUpload ID="HrisUploader" runat="server" /> </td> </tr> <tr> <td></td> <td> </td> <td></td> </tr> </table> </div> <div id="GenerateReportDiv" runat="server" align="center" style="position: relative; z-index: inherit; width: auto; height: auto; top: auto; right: auto; bottom: auto; left: auto"> <table> <tr> <td> <asp:Button ID="btnGenerateReport" runat="server" Text="Generate Allocation Report" onclick="btnGenerateReport_Click" Font-Names="Verdana" Font-Size="10pt" UseSubmitBehavior="True" OnClientClick="return postbackButtonClick();" ClientIDMode="Static" /> </td></tr> </table> </div> <div id="divConfirmation" runat="server" align="center" style="position: relative; z-index: inherit; width: 930px; height: auto; top: 0px; right: 0px; bottom: 0px; left: 0px"> <table> <tr> <td> <asp:Label ID="lblCnfrm" runat="server" Text="Label" Font-Bold="True" ForeColor="Red" Font-Names="Verdana" Font-Size="Small" ></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="lblHRISCnfrm" runat="server" Text="Label" Font-Bold="True" ForeColor="Red" Font-Names="Verdana" Font-Size="Small" ></asp:Label> </td> </tr> <tr> <td> <asp:Label ID="lblAllocationCnfrm" runat="server" Text="Label" Font-Bold="True" ForeColor="Red" Font-Names="Verdana" Font-Size="Small" ></asp:Label> </td> </tr> </table> </div> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="btnGenerateReport" /> </Triggers> </asp:UpdatePanel> <div id="divUpdateProgress" runat="server"> <asp:Updateprogress id="UpdateProgress" runat="server" associatedupdatepanelid="UpdPanel"> <Progresstemplate> <div id="Layer1" style="removed:absolute; z-index:1; removed 50%;removed 50%;"> <img src="Images/waiting.gif" alt="" /> </div> </Progresstemplate> </asp:Updateprogress> </div> </asp:Content>


这篇关于UpdateProgress正在使用下载文件选项,但下载后仍在旋转.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆