问题描述
<$c$c>Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler)$c$c>对我不起作用,因为这将触发之后的任何更新面板完成加载,我找不到任何客户端的方式找到这是一个
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler)
does not work for me because this will fire after ANY update panel finishes loading, and I can find no client side way to find which is the one
ScriptManager.GetCurrent(页).AsyncPostBackSourceElementID AsyncPostBackSourceElementID
对我不起作用,因为这是一个服务器端的对象,我想客户端
ScriptManager.GetCurrent(Page).AsyncPostBackSourceElementID AsyncPostBackSourceElementID
does not work for me as this is a server side object, and i want Client Side
客户方的.Net框架必须知道哪些UpdatePanel中被更新,以更新正确的内容。当然,还有一种方法可以挂接到这个活动?
The ClientSide .Net framework must know which UpdatePanel it is updating in order to update the correct content. Surely there is a way to hook into this event?
任何帮助将是AP preciated。
Any help would be appreciated.
推荐答案
您可以挂钩的 PageRequestManager.beginRequest 事件并检查BeginRequestEventArgs.postBackElement属性。
You can hook the PageRequestManager.beginRequest event and inspect the BeginRequestEventArgs.postBackElement property.
请注意,这不的真正的给你的UpdatePanel,但在UpdatePanel的内部控制。这应该是足够好的,但。
Note that it doesn't really give you the UpdatePanel, but the control inside of the UpdatePanel. That should be good enough, though.
编辑:更妙的是, PageRequestManager.pageLoaded 事件给你的(和的)的属性。
Even better, the PageRequestManager.pageLoaded event gives you PageLoadedEventArgs.panelsUpdated (and panelsCreated) properties.
这篇关于如何调用客户端的JavaScript功能后,具体的UpdatePanel已经加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!