简体   繁体   English

为什么在执行任何操作javascript元素后,在ASP.NET Ajax Update Panel中停止工作?

[英]Why in ASP.NET Ajax Update Panel after any action javascript elements stop working?

I am writing a web application in C# with ASP.NET. 我正在用ASP.NET用C#编写Web应用程序。 For performance I'd like to insert a UserWebControl in an Update panel to enable AJAX. 为了提高性能,我想在“ Update panel插入UserWebControl来启用AJAX。

On the same UserWebControl I have a menu that is powered by jQuery. 在同一UserWebControl我有一个由jQuery驱动的菜单。 When the page loads, the menu is working perfectly but after some server side actions in the Update Panel , the menu and other javascript-based controls stop working. 页面加载后,菜单运行正常,但在“ Update Panel中的某些服务器端操作之后,菜单和其他基于JavaScript的控件停止运行。

try this: 尝试这个:

<script type="text/javascript">
    function pageLoad() {
        //your jquery goes here
    }
</script>

i don't understand the problem exactly but i guess that after the page is loaded you are executing some JavaScript functions. 我不完全了解问题,但我想页面加载后正在执行一些JavaScript函数。 Then when you update your UserControl using asp.net UpdatePanel it's actually being loaded again, then you need to execute your JavaScript functions again... 然后,当您使用asp.net UpdatePanel更新UserControl时,实际上已再次加载了它,那么您需要再次执行JavaScript函数...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM