如何使用更新面板调用 javascript 函数
我的解决方案中有一个更新面板。更新面板包含三列(div - s),其中包含动态添加的内容。我决定如果每个树列都具有相同的高度会更好,并且还决定使用 javascript 函数。问题是:如何在更改列高的事件上调用 javascript 函数?
我尝试在回发事件中使用它,
Page.ClientScript.RegisterStartupScript(this.GetType(), "check", "check()", true);
但这不起作用......请帮助......
I have an Update panel in my solution. Update panel contains three columns(div - s) with dynamically added content. I desided that it would be better if each of tree columns would have the same height, and also desided to use javascript function. The problem is: how to call javascript function on event that changes columns height?
I tried to use this on postback event
Page.ClientScript.RegisterStartupScript(this.GetType(), "check", "check()", true);
but this don't works... please help....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
像这样使用,这会有帮助。
use like this, this will help.
最简单的方法是在 JavaScript 代码中使用 MSAjax pageLoad 事件:
我已经使用过它很多次了,它的工作原理就像魅力一样。最重要的是不要将它与 document.ready 函数混淆(该函数仅在页面文档对象模型 (DOM) 准备好执行 JavaScript 代码后执行一次),但 pageLoad 事件将在每次更新面板时执行刷新。
来源:更新面板 AJAX asp.net 后运行脚本
Most simple way is to use MSAjax pageLoad Event in your javascript code :
I have used it many times, it works like charm. Most important thing is don't confuse it with document.ready function (which will be executed only once after the page Document Object Model (DOM) is ready for JavaScript code to execute),yet pageLoad Event will get executed every time the update panel refreshes.
Source: Running script after Update panel AJAX asp.net