keeping div height on screen.availHeight in combination with AJAX (and the scrollprosition)

  • Thread starter Thread starter ton
  • Start date Start date
T

ton

Hi,

I've a treeview in a DIV, with scrollbars. The height of the div depends on
the screen.availHeight.
On onload and onresize this value is updated. Now my problems:

- using Ajax a buttonclick will reset the height of the div tag to the
original one
- i've use a =SetDivPosition() to keep the actual scroll position, but since
window.load isn't called using ajax the last scrollposition is not restired.

There must be a function for the window I can use to restore height and
scrollposition?

Thanx


ton
 
I've found the solution on the web and I've added a script block just after
the </asp:ScriptManager> tag

the ResetPositions function is called and everything works fine !

<body id="doc">
<form id="form1" runat="server">
<asp:ScriptManager id="ScriptManager1" runat="server">
</asp:ScriptManager>
<script type="text/javascript" language="javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

function EndRequestHandler (sender, args)
{
ResetPositions();
}
</script>
 
Back
Top