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

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
 
T

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top