Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a list with paging enabled and a page size of 10.

When you scroll to the bottom of the page hit the next button in the list the page redirects to itself with different querystring parameters related to the paging AND the scroll position gets maintained. This is really annoying from a usability point of view.

Ideally the scroll position should not be maintained when the next button is clicked.

Can anyone help with this please?

share|improve this question
add comment

2 Answers

I think this is due to the property "MaintainScrollPositionOnPostBack" in the PAGE Class, There are couple options to resolve this.

1) Jquery : add a content editor webpart pointing to external txt/html file with the following code

$(function(){ $(window).scrollTop(0); } );

2) Server Webpart : override the property on Page_Load and add this webpart to the page . Use Delegate control if required for whole site/site collection.

this.Page.MaintainScrollPositionOnPostBack = false;

share|improve this answer
add comment

You should add the following script in the html page:

<script>var p = $("p:first");
$("p:last").text( "scrollTop:" + p.scrollTop() );

</script>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.