title: Keeping page scroll after async postback
body: <p>I have the following javascript code to keep my page scroll at the same level as it was before the async postback. Right now it bumps upward/downward when scrolling sometimes. It happened without this function as well. Is there any good way of preventing the postback to affect the page scroll, like at all? So users won't even feel it?</p>
  
  <pre><code>var xPos2, yPos2;
  var prm2 = Sys.WebForms.PageRequestManager.getInstance();
  prm2.add_beginRequest(BeginRequestHandler2);
  prm2.add_endRequest(EndRequestHandler2);
  function BeginRequestHandler2(sender, args) {
      xPos2 = $(window).scrollLeft;
      yPos2 = $(window).scrollTop;
  }
  function EndRequestHandler2(sender, args) {
      $(window).scrollLeft = xPos2;
      $(window).scrollTop = yPos2;
  }
  </code></pre>