ASP.NET: timer and scroll position

Got a timer inside the update panel. It is constantly refreshing (approximately every 2.5 seconds). If it is updated while scrolling, it sets the position of scrolling back to what it was before the partial update :(

I am using ASP.NET 3.5, and MaintainScrollPositionOnPostback is set to false (even if set to true, this does not change).

I don't know why this is happening, but usability is annoying ...

Regards, Sascha

+3
source share
1 answer

, reset . : http://forums.asp.net/t/1047815.aspx

javascript ScriptManager .

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<script type="text/javascript">
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_beginRequest(beginRequest);

    function beginRequest() {
        prm._scrollPosition = null;
    }
</script>

, reset .

, , . : Reset Async postback - ASP.NET, .

+4

Source: https://habr.com/ru/post/1704485/


All Articles