Save scrollbar Div, in a MasterPage
Posted
by Luis
on Stack Overflow
See other posts from Stack Overflow
or by Luis
Published on 2010-03-30T07:38:56Z
Indexed on
2010/03/30
7:43 UTC
Read the original article
Hit count: 465
have got succesfull done it in the content pages, but in the masterpage, I am not able to done it. I tried this way, it was like I did for content pages.
<script type="text/javascript">
// This Script is used to maintain Grid Scroll on Partial Postback
var scrollTop;
//Register Begin Request and End Request
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
//Get The Div Scroll Position
function BeginRequestHandler(sender, args)
{
var m = document.getElementById('<%=PanelMenuLeft.ClientID%>');
m.scrollTop = scrollTop;
}
//Set The Div Scroll Position
function EndRequestHandler(sender, args)
{
var m = document.getElementById('<%=PanelMenuLeft.ClientID%>');
m.scrollTop = scrollTop;
}
</script>
© Stack Overflow or respective owner