Imagine the scenario: Your application has a large web form that you need to scroll down to see all its content. At the bottom there is a button that posts the page to the server. After the postback, the page is displayed on the top. What if you want to scroll down until the same position you were before the post?
Define at the page level
To define for a specific page only, you may add the property MaintainScrollPositionOnPostback to the page directive and set its value to true:
<%@ Page Language=”C#” AutoEventWireup=”true” CodeBehind=”Default.aspx.cs” Inherits=”Tip176._Default” MaintainScrollPositionOnPostback=”true” %>
Define at the application level
Open the web.config file of your application and add the attribute maintainScrollPositionOnPostback to the pages section and set its value to true. Pay attention to the fact that the name is case sensitive: