更新面板AJAX asp.net后运行脚本 [英] Running script after Update panel AJAX asp.net
问题描述
我在我的网站上运行的AJAX更新面板,更新面板返回一些新的控制,我想设置一些JavaScript代码的控制后,他们从Ajax调用返回。没有办法这样做的。感谢您的帮助。
I am running a ajax update panel in my website, The update panel returns some new controls, I would like to set some javascripts for the controls after they are returned from the ajax call. any way of doing this. Thanks for any help.
推荐答案
扎入MSAjax事件
function pageLoad(){ }
这将激发每一个更新面板刷新的时间..你可以在那里做你重新绑定/新的绑定
this will fire every time the update panel refreshes.. you can do your rebinding / new bindings there
...是的,这就是你需要做的,把页面上的,它会火。
...and yes, that's all you need to do, put that on the page and it will fire.
更新:: [看起来像我有正确命名的功能(我认为这将仍然工作寿) 它真的很简单,如果你有在页面上的脚本经理..
Update:: [looks like i had the function named incorrectly ( i think it would still work tho) ] it's really that simple if you have a script manager on the page..
<script>
///<summary>
/// This will fire on initial page load,
/// and all subsequent partial page updates made
/// by any update panel on the page
///</summary>
function pageLoad(){ alert('page loaded!') }
</script>
<一个href="http://www.asp.net/ajax/documentation/live/overview/AJAXClientEvents.aspx">http://www.asp.net/ajax/documentation/live/overview/AJAXClientEvents.aspx
这篇关于更新面板AJAX asp.net后运行脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!