SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to control the scroll position on postback in SharePoint 2010?

I have a web part that I want the users to be special position of the page after a postback on a button click.

share|improve this question
up vote 5 down vote accepted

Step 1: Navigate to your Default.Master Page in Sharepoint Designer and add the following Line:

<%@ Page Language=”C#” AutoEventWireup=”true” MaintainScrollPositionOnPostback=”true” %>

Step 2: Save and publish your Default.Master Page, you will notice that Sharepoint Designer has modified the above line to something like the following (Depending on your Sharepoint Version):

<%@ Page Language=”C#” AutoEventWireup=”true” MaintainScrollPositionOnPostback=”true” inherits=”Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>

Step 3: Add # anchor tags as per normal HTML to your Web Part Pages and your Scroll Position will be maintained on Postback

Answer referred from this post

If that does not help, check this post from msdn which implements it with Javascript.

share|improve this answer

You can do this in HTML by specifying an anchor tag, giving it a name and then appending the # to the end of the Url when doing the postback. :)

Alternatively you can use javascript when the page loads and have a hidden field with the anchor to scroll to.

share|improve this answer

Your Answer


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.