maintain scrollback on ajax modal pop up extender
<p>I have the following site structure. This is a .net 3.5.</p>

<p>Master Page -> Content Page -> Modal Pop up extender -> User control -> Panel -> Update Panel -> div</p>

<p>The div is where all the form elements are. Now, when I click a checkbox or any button that results a postback, the usercontrol starts from the top. It does not maintain the scrollback. I ran across a post about implementing the script below but this doesn't help me any. Is there a fix for this?</p>

<p>Below is the script I used.</p>

<pre><code>&lt;script type="text/javascript"&gt;
var xPos, yPos;
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(BeginRequestHandler);
prm.add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
    xPos = $get('div').scrollLeft;
    yPos = $get('div').scrollTop;
}
function EndRequestHandler(sender, args) {
    $get('div').scrollLeft = xPos;
    $get('div').scrollTop = yPos;
}
</code></pre>

<p></p>
