title: Last Page Event Executed On Callback
body: <p>I have a WebForm with many controls, including a large number of grids. I added some callback functions on these grids to refresh their DataSource and to update some global variables in a public static class <strong>after</strong> each refresh.</p>
  
  <p>Normally I would add some method calls in the <code>PageLoadComplete</code> Event Handler, but the callbacks get raised after that. I also tried using the <code>OnPrerender</code>, <code>OnPrerenderComplete</code> and <code>OnSaveStateComplete</code> method overrides, but these don't seem to work with callbacks. (I can't use the <code>OnUnload</code> override since I need to use the <code>Request</code> object.)</p>
  
  <p>And here is the Actual Question:<br>
  Is there any event handler I can use? Or can I create an event and raise it after everything else has finished?</p>
  
  <p>I want it to execute as the last step in every callback/post-back of any kind (but before page unload so i can still use the <code>Response</code> and <code>Request</code> objects).</p>
  
  <p>The grids are DevExpress's ASPxGridViews.</p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After searching for a while, I found out that the <code>PreRender</code> event is fired during async Postbacks of asp:UpdatePanels but not during DevExpress's Callbacks (it is normal behavior).</p>
  
  <p>So, what would really help is finding/creating an event which I can use. I'm also thinking of grabbing the data I want from the Request Object during the PageLoad execution and using them later at Unload.</p>
  
  <p>What are the pros and cons of each approach? Is there anything important that I need to know before making a decision, or is there anything I might be overlooking? I'm concerned about going with the second option since I'd have to declare some class variables and I feel like there are already too many of them.</p>