jquery needs to rebind events on partial page postback

后端 未结 5 1847
别那么骄傲
别那么骄傲 2021-01-05 00:47

How can I rebind my events (jquery) when I perform a partial page postback?

I am wiring everything up using:

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


        
5条回答
  •  走了就别回头了
    2021-01-05 01:20

    Some DOM elements are replaced when you do a partial postback, and of course, the new elements will loose jQuery bindings. You can use the ScriptManager class to register a script that will be executed after the partial postback finishes (have a look here)

提交回复
热议问题