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

后端 未结 5 1564
攒了一身酷
攒了一身酷 2020-11-27 11:52

I\'m using a jQuery tip plugin to show help tips when the user hovers certain elements of the page.

I need to register the plugin events after the page is loaded usi

5条回答
  •  盖世英雄少女心
    2020-11-27 12:22

    Instead of putting your jQuery code inside of $(document).ready(), put it inside

    function pageLoad(sender, args) { 
        ... 
    }
    

    pageLoad is executed after every postback, synchronous or asynchronous. pageLoad is a reserved function name in ASP.NET AJAX that is for this purpose. $(document).ready() on the other hand, is executed only once, when the DOM is initially ready/loaded.

    See this Overview of ASP.NET AJAX client lifecycle events

提交回复
热议问题