468,256 Members | 1,426 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,256 developers. It's quick & easy.

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

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

Oct 20 '08 #1
1 1621
ton
I've found the solution on the web and I've added a script block just after
the </asp:ScriptManagertag

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>

"ton" <to*@nospam.nlschreef in bericht
news:c6***************************@cache5.tilbu1.n b.home.nl...
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
Oct 20 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Raffi | last post: by
9 posts views Thread by pow67 | last post: by
24 posts views Thread by dE|_ | last post: by
3 posts views Thread by =?Utf-8?B?S2V2aW4=?= | last post: by
5 posts views Thread by tader | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.