UpdatePanel和java脚本 [英] UpdatePanel and java script

查看:98
本文介绍了UpdatePanel和java脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我在我的表单中使用UpdatePanel但是在运行我的网站表单时,所有javascript方法都不起作用。

请帮助我谢谢

hi I use an UpdatePanel in my form but when run my website form , all javascript method don't work.
please help me thanks

推荐答案

我猜你可能正在使用带有更新面板的AsyncPostBackTrigger。

会导致部分回发,而在部分回复中,完整的DOM不会刷新。所以你的脚本不起作用。



那么你可以用两种方式解决这个问题。



1-从服务器端注入脚本



2-using javascript function pageLoad(){}



你可以将你的所有剧本包裹在里面



I guess you might be using AsyncPostBackTrigger with update panel.
which causes the partial post back and as in partial postaback complete DOM does not refresh. so your scripts would not be working.

Well You can cop up this issue in two ways.

1- inject scripts from server side

2-using javascript function pageLoad() {}

YOu can wrap all your scripts inside

 function pageload()
{

/////All your scripts
}





参考链接: 如何在更新面板回发后执行了javascript回调?



并希望能够正常运行。 :)



REFERENCE LINK: How to have a javascript callback executed after an update panel postback?

and hope that will work. :)


也将您的脚本包含在更新面板的内容模板中
Include your script also in content template of ur update panel


这篇关于UpdatePanel和java脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆