Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
Jquery with WebAsyncRefreshPanel
posted

Hello.. Someone posted a marvelous bit of code that will cause ASP.NET's update panel to use jquery effects when changing.. This little piece of code will make the panel fade out, change its content, then fade back in.. Simply by hooking into the  Sys.WebForms.PageRequestManager.getInstance()._updatePanel

    <script type="text/javascript">
$(document).ready(
function() {
var old_prm_updatePanel = Sys.WebForms.PageRequestManager.getInstance()._updatePanel;

Sys.WebForms.PageRequestManager.getInstance()._updatePanel =
function(updatePanelElement, rendering) {
$(updatePanelElement).fadeOut('fast',
function() {
loadShowUpdatePanel(old_prm_updatePanel, updatePanelElement, rendering);
});
}
});

function loadShowUpdatePanel(old_prm_updatePanel, updatePanelElement, rendering) {
old_prm_updatePanel.apply(Sys.WebForms.PageRequestManager.getInstance(),
new Array(updatePanelElement, rendering));
$(updatePanelElement).fadeIn('fast');
pageLoaded();

}

</script>

im trying to duplicate this behavior.. Is it possible? Someone with advanced javascript knowledge would need to answer this one i think ;) I looked into one of the webresource.axd files and see a bunch of functions to do callbacks such as WebForm_ExecuteCallback.. However the example above uses an instance of the _updatePanel object inside the Sys.WebForms.PageRequestManager. Since im not using the ASP.NET AJAX, there is no PageRequestManager, or even Sys.WebForms..


Is there a similar instance I could hook into with the WebAsyncRefreshPanel to make jquery fade it in and out? Hope this makes any sense!