Knance
asked on
Maintain scroll position of DIV through postback in masterpage
I have a master page with an update panel wrapping up the content template. In one of my pages I have a grid view that is residing in a Div that utilizes the overflow method to produce scroll bars. I need to be able to retain the scroll position through post back. I have tried about a dozen 'solutions' to this (all JS) and none of them seem to work in conjunction with the master page. Please help! ><
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As with most of these solutions after your script manager add :
<script type="text/javascript">
var xPos, yPos;
var prm = Sys.WebForms.PageRequestMa
prm.add_beginRequest(Begin
prm.add_endRequest(EndRequ
function BeginRequestHandler(sender
try {
yPos = $get('ctl00_MainContent_sc
}
catch (err) { }
}
function EndRequestHandler(sender, args) {
try {
$get('ctl00_MainContent_sc
}
catch (err) { }
}
</script>
Check your source for your div id...mine was 'scroll' in code but as you see during runtime master page changes that a bit....hope this helps anyone else having issues.