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

Discussion in 'ASP .Net' started by ton, Oct 20, 2008.

  1. ton

    ton Guest

    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
     
    ton, Oct 20, 2008
    #1
    1. Advertisements

  2. ton

    ton Guest

    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>
     
    ton, Oct 20, 2008
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.