Search code examples
jqueryasp.netupdatepaneldocument-ready

using Document.ready with update panel


I have J Query events is assigned in document.ready, my page is also have update panel. when partial post back is happened in the page, I loss J query events. is there Conflict between document.ready and update panel? how can I solve that?


Solution

  • document.ready function will not work after a call back .. you need to call that function after every post back.. there are number of solutions

    1) use pageLoad instead of document.ready

     function pageLoad() {
     //execute code
     }
    

    2) or you can register your function after a call back

     ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(String), "function",      "try{function();}catch(err){}", True)
    

    3) or you can call your function in

        function page_EndRequest(sender, args) {
         // your Code
         }