[英]ajax progress bar not working?
I am trying to present a ajax progress bar when a delete button is clicked. 单击删除按钮时,我试图显示一个ajax进度栏。 This delete button will do things and will take time to process.. The delete button is within a repeater.
此删除按钮将起作用,并且需要一些时间来处理。删除按钮位于转发器内。 The code is below:
代码如下:
<asp:UpdatePanel runat="server" ID="upDatePanel" UpdateMode="Conditional">
<ContentTemplate>
<asp:UpdateProgress runat="server" ID="UpdateProgress1" DynamicLayout="false" AssociatedUpdatePanelID="upDatePanel">
<ProgressTemplate>
<img id="Img1" runat="Server" src="~/Images/ajax-loader.gif" height="50" width="50" alt=""/>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:Repeater ID="rptWork" runat="server" OnItemDataBound="rptWork_ItemDataBound">
<ItemTemplate>
<tr>
<td>
<asp:LinkButton ID="btnDelete" OnClick="btnDelete_Click" Text="Delete" runat="server" />
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr>
<td>
<asp:LinkButton ID="btnDelete" OnClick="btnDelete_Click" Text="Delete" runat="server"/>
</td>
</tr>
</AlternatingItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
I have put in a Thread.Sleep behind the delete button so when user clicks the progress bar appears however the process time takes abit longer. 我在“删除”按钮后面放置了一个Thread.Sleep,因此当用户单击进度条时,处理时间会花费一些时间。 How can i make the progress bar stay on screen until the process is fully complete?
如何使进度条保持在屏幕上,直到过程完全完成?
Try changing the UpdateMode="Always" to see if your getting page updates. 尝试更改UpdateMode =“ Always”来查看获取页面是否更新。
If you use conditional you will have to call Update yourself on the panel (not sure if your doing this??) 如果您使用条件式,则必须在面板上调用“更新自己”(不确定是否这样做?)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.