Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. $("#myUpdatePanel").on("update", myFunc);
  2.  
  3. $.updatePanel.on("update", myRunOnceFunc);
  4.  
  5. // wrap updatePanel reload functionality
  6. $.updatePanel = (function () {
  7. var prm;
  8.  
  9. var UpdatePanel = function () { };
  10. UpdatePanel.prototype = { };
  11.  
  12. // initialize on $(document).ready()
  13. $(function () {
  14. prm = Sys.WebForms.PageRequestManager.getInstance();
  15. if (prm) {
  16. prm.add_pageLoaded(function (s, e) {
  17. $.each(e.get_panelsUpdated(), function () {
  18. // "this" is the asp:UpdatePanel's div
  19. updateControls.call(this);
  20.  
  21. // call panel-specific update event handlers
  22. $(this).trigger($.Event("update"));
  23. });
  24. });
  25.  
  26. // triggered once no matter how many panels were updated
  27. $(UpdatePanel).trigger($.Event("update"));
  28. }
  29. });
  30.  
  31. return $(UpdatePanel);
  32. })();
  33.  
  34. $(function() { $.updatePanel.on("update", myRunOnceFunc); });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement