2

I take advantage of an update panel and would like to use the ScrollPositioning but it doesn't work.

I use maintainScrollPositionOnPostBack="true" in .aspx pages.

What can I do so that it works?

Shishdem
  • 499
  • 1
  • 5
  • 19
Nilgün
  • 51
  • 2
  • 8

2 Answers2

1

This is one of the possible sollutions taken from Personal Blog of Mustafa Başgün enter image description here https://basgun.wordpress.com/2008/06/09/maintain-scroll-position-updatepanel-postback/

Cristina Alboni
  • 1,014
  • 9
  • 15
0

I'm using this solution (require jQuery):

<script type="text/javascript">

    var docScrollTop;
    var prm = Sys.WebForms.PageRequestManager.getInstance();

    function BeginRequestHandler(sender, args) {
        docScrollTop= $(document).scrollTop();
    }

    function EndRequestHandler(sender, args) {
        $(document).scrollTop(docScrollTop);
    }

    prm.add_beginRequest(BeginRequestHandler);
    prm.add_endRequest(EndRequestHandler);

</script>
gidanmx2
  • 469
  • 1
  • 9
  • 24