Development Experience

Wednesday, August 13, 2014

jQuery $(document).ready , UpdatePanels and Events

Today I faced with a problem Update Panel and JQuery $(document).ready
When post back happens all my client side events were lost. To prevent this issue I used following solutions below.
 var prm = Sys.WebForms.PageRequestManager.getInstance();  
 prm.add_endRequest(function() {  
   // re-bind your jQuery events here  
 $(document).ready(function() {  
   // bind your jQuery events here initially  
 });  
 });  
Here is the post which I used. http://stackoverflow.com/questions/256195/jquery-document-ready-and-updatepanels

No comments:

Post a Comment