下拉列表 updateprogress 和 updatepanel 的问题
更新进度不显示 gif。如果下拉列表位于 updatepanel 内部且没有触发器,则它可以工作。有什么想法吗?
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
<asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server" DisplayAfter="0">
<ProgressTemplate>
<div id="IMGDIV" align="center" valign="middle" runat="server" style="position: absolute;left: 52%;top: 61%;visibility:visible;vertical-align:middle; background-color:Transparent">
<img src="../App_Themes/Default/images/27-1.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<cc1:Chartlet ID="Chartlet1" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="selectedindexchanged" />
</Triggers>
</asp:UpdatePanel>
The updateprogress doesnt show the gif. If the dropdownlist is inside updatepanel without trigger, it works. Any idea?
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
<asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server" DisplayAfter="0">
<ProgressTemplate>
<div id="IMGDIV" align="center" valign="middle" runat="server" style="position: absolute;left: 52%;top: 61%;visibility:visible;vertical-align:middle; background-color:Transparent">
<img src="../App_Themes/Default/images/27-1.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<cc1:Chartlet ID="Chartlet1" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="selectedindexchanged" />
</Triggers>
</asp:UpdatePanel>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据设计,UpdatePanel 的外部触发器不会触发关联的 UpdateProgress,因为启用 UpdateProgress 控件的实现会在控件层次结构中搜索调用控件;外部触发器不会出现在控制层次结构中。
我在这里找到了答案:Updateprogessbar is not work whensetting AssociatedUpdatePanelID? 。
所以我只需删除:AssociatedUpdatePanelID="UpdatePanel1"
By Design External triggers for an UpdatePanel do not fire an associated UpdateProgress, since the implementation of enabling the UpdateProgress control searches the control hierarchy for the calling control; an external trigger will not be present in the control hierarchy.
I found the answer here: Updateprogessbar is not working when Setting AssociatedUpdatePanelID?.
So I had just to delete: AssociatedUpdatePanelID="UpdatePanel1"
我也有同样的问题。
只需从
UpdateProgress
中删除以下属性:AssociatedUpdatePanelID="UpdatePanel1"
I had the same problem.
Just remove the following property from your
UpdateProgress
:AssociatedUpdatePanelID="UpdatePanel1"
我希望你不是在谈论“gif动画”。如果您使用 IE,则在设计时在 aspx/ascx 中指定的 gif 动画中会出现问题。我使用 类似 blockUI 的插件,它在运行时添加 gif
I hope you are not talking about "gif animation". If you are using IE, it has problems in animating the gifs which are specified at aspx/ascx at design time. I use a plugin like blockUI, which adds the gif at run time