Document.Ready() is not working after PostBack

前端 未结 8 1853
天命终不由人
天命终不由人 2020-12-02 18:39

I have a page that contains a user control within an update panel. $(document).ready(function() ) { is called and executes the code correctly when the page firs

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-02 19:22

    I was also facing the same problem but i found the jQuery $(document).ready event handler works when page loads, but after ASP.Net AJAX UpdatePanel Partial PostBack it does not get called. so use Sys.Application.add_load(function(){}); instead of $(document).ready. This works perfectly for me :)

提交回复
热议问题