Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#myUpdatePanel").on("update", myFunc);
- $.updatePanel.on("update", myRunOnceFunc);
- // wrap updatePanel reload functionality
- $.updatePanel = (function () {
- var prm;
- var UpdatePanel = function () { };
- UpdatePanel.prototype = { };
- // initialize on $(document).ready()
- $(function () {
- prm = Sys.WebForms.PageRequestManager.getInstance();
- if (prm) {
- prm.add_pageLoaded(function (s, e) {
- $.each(e.get_panelsUpdated(), function () {
- // "this" is the asp:UpdatePanel's div
- updateControls.call(this);
- // call panel-specific update event handlers
- $(this).trigger($.Event("update"));
- });
- });
- // triggered once no matter how many panels were updated
- $(UpdatePanel).trigger($.Event("update"));
- }
- });
- return $(UpdatePanel);
- })();
- $(function() { $.updatePanel.on("update", myRunOnceFunc); });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement