Ajax: How to Maintain Scroll Position Following Postback

aspnet.pngAnother quick note to myself:  I keep forgetting how to make an ASP.Net page maintain scroll position following a post back. The answer is…

…to add a “MaintainScrollPositionOnPostback” attribute to the page.

For example:

<%@ Page Language=”vb” AutoEventWireup=”false” Codebehind=”Detail_SessionInstance_Incidents.aspx.vb”
    Inherits=”YouthStats.Detail_SessionInstance_Incidents” MaintainScrollPositionOnPostback=”true” %>

Leave a Reply