jQuery $(document).ready and UpdatePanels?

后端 未结 19 1507
庸人自扰
庸人自扰 2020-11-22 01:32

I\'m using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in $(document).ready . For example:

19条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 01:50

    Update Panel always replaces your Jquery with its inbuilt Scriptmanager's scripts after every load. Its better if you use pageRequestManager's instance methods like this...

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(onEndRequest)
        function onEndRequest(sender, args) {
           // your jquery code here
          });
    

    it will work fine ...

提交回复
热议问题