一个更新面板更新了,另一个也更新了?
我有一个场景,页面上有两个更新面板(都有更新模式=“条件”)。 如果我更新一个更新面板,另一个更新面板也会自动更新。 这是第一个问题。
我正在使用UpdatePanelAnimationExtender。 如果一个更新面板已更新,则该面板没有 updatepanelAnimationExtender,而另一面板也已更新且具有 updatepanelAnimationExtender、OnUpdatingUpdatePanel(); 事件被触发。 正如 updatepanelAnimationExtender 的文档所述: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ UpdatePanelAnimation/UpdatePanelAnimation.aspx
OnUpdating - 当任何 UpdatePanel
开始更新时播放的通用动画
OnUpdated - 在 UpdatePanel
之后播放的通用动画>UpdatePanel 已完成更新(但前提是 UpdatePanel
已更改)
问题: OnUpdating
已触发并且它在后端运行但未完成因为 onUpdated
仅在 UpdatePanel
更改时触发
I have scenario, I have two update panels on the page (both have update mode='conditional'). If I update one update panel the other is automatically updated. This is first problem.
I am using UpdatePanelAnimationExtender. If one update panel is updated, that don’t have updatepanelAnimationExtender other one also updated and that have updatepanelAnimationExtender, OnUpdatingUpdatePanel(); event is fired.
As the documentation of updatepanelAnimationExtender says:
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/UpdatePanelAnimation/UpdatePanelAnimation.aspx
OnUpdating - Generic animation played as when any UpdatePanel
begins updating
OnUpdated - Generic animation played after the UpdatePanel
has finished updating (but only if the UpdatePanel
was changed)
Problem: OnUpdating
fired and it worked backend and not finished because onUpdated
only fired when an UpdatePanel
Changed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“在页面上添加 2 个更新面板,为两个更新面板设置 updatemode='conditional',为两个更新面板添加加载事件,为两个加载事件设置断点,添加 1 个按钮,然后为按钮单击 1 个更新面板添加 Asyn 触发器......您会注意到,当您点击按钮时,它应该仅加载触发的更新面板,并且第二个更新面板保持不变,但第二个更新面板也触发了加载事件“
只有当按钮位于第二个更新面板内时才会发生这种情况? 如果没有,那么我认为它不会更新第二个更新面板。 您能否确认该按钮是在第二个更新面板内部还是外部?
"Add 2 update panel on page, set updatemode='conditional' for both and add load event for both updatepanel and set breakpoint for both load event and add 1 button and then add Asyn trigger for button click on 1 update panel.... you will notice when you hit button, it should load only triggered update panel and 2nd one remain unchanged, but 2nd updatepanel is load event also fired"
This will happen only if the button is inside the 2'nd updatepanel? If not, then I dont think it will update the second update panel. Could you confirm if the button is inside or outside the second updatepanel?
我刚刚遇到了同样的问题。 同一页面上的两个更新面板不嵌套且具有 UpdateMode="Conditional"。 只需要意识到,当页面上的一个更新面板触发部分回发时,所有更新面板都会触发更新事件。 如果您将 UpdatePanelAnimationExtender 连接到 UpdatePanel A,并且为不相关的 UpdatePanel B 触发了部分回发,则两者都会触发更新事件,并且 UpdatePanel A 的动画将仅运行 OnUpdating 部分,而不运行 OnUpdated 部分(因此基本上动画会运行一半)。
这就是我解决这个问题的方法:
确定触发了哪个更新面板。 这可以通过获取脚本管理器的表单变量的值来找到。 有问题的更新面板将在字符串中提及。 使用此信息根据您的需求执行操作。
我希望这可以帮助别人。
I just had this same issue. Two update panels on the same page that are NOT nested and have UpdateMode="Conditional". Just realize that when one update panel on a page triggers a partial postback, all update panels will get the updating event triggered. If you have an UpdatePanelAnimationExtender hooked up to UpdatePanel A, and a partial postback is triggered for an unrelated UpdatePanel B, both will get the updating event triggered, and the animation for UpdatePanel A will only run the OnUpdating part and not the OnUpdated part (so basically the animation will run half way).
This is how I fixed this issue:
Determine which update panel was triggered. This can be found by getting the value of the form variable for the script manager. The update panel in question will be mentioned in the string. Use this info to perform an action based on your needs.
I hope this helps someone.