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!
Hello,
Thank you for posting your solution to the forum. It will be valuable to someone with the same requirement.
Thank you for your contribution.
Well no one replied.. but I figured it out myself..
function igPanel_RefreshRequest(oPanel,oEvent,id) { /* ID IS THE ID OF THE CONTROL THAT INITIATED THE POSTBACK */ var panelID = oPanel.getID(); $("#" + panelID).fadeOut(); } function igPanel_RefreshComplete(oPanel) { var panelID = oPanel.getID(); $("#" + panelID).fadeIn(); }
<igmisc:WebAsyncRefreshPanel id="igPanel_ReportCriteria" runat="server" RefreshComplete="igPanel_RefreshComplete" RefreshRequest="igPanel_RefreshRequest">
...... . . ...</igmisc:WebAsyncRefrehPanel>