里面的UpdatePanel jQuery的事件处理回发后不工作 [英] jquery event handler inside updatepanel not working after postback

查看:142
本文介绍了里面的UpdatePanel jQuery的事件处理回发后不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有ID = ShowDetails的div。在我的javascript我有这样的:

I have a div with "id=ShowDetails". In my javascript I have this:

    $(document).ready(function () {
       UIactions();
    });

    function UIactions () {
        $('#ShowDetails').click(function () {
            alert("bingo");
          }
     });

DIV的是,被调回更新面板内。在加载页面时,如果我点击在div,我得到了宾果而回发后,我不知道。任何想法,为什么?

The div is inside the update panel that gets posted back. When the page loads, if I click the div, I get the bingo but after the postback, I don't. Any idea why?

感谢。

推荐答案

我知道这是一个很老的职位,但我来到这个由具有我的jQuery脚本不更新面板中的内容后的工作问题已更新。

I know that this is a really old post, but i came by this by having the issue that my jQuery script didn't work after content inside an update panel was updated.

我发现了一个简单的解决方案和所有其他的解决方案是不值得看的:)

I found an easy solution and all the other solutions are not worth looking at :)

简单只记得你的asp.net控件添加到的UpdatePanel的 触发器作为回传。

Simple just remember to add your asp.net controls to the UpdatePanel's Triggers as postback.

<Triggers>
     <asp:PostBackTrigger ControlID="....." />
</Triggers>

希望这有助于别人,因为我花了太多时间在寻找解决方案。

Hope this help someone, because i have spent too much time on finding the solution.

这篇关于里面的UpdatePanel jQuery的事件处理回发后不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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