ASP.NET: Maintain Scroll Position On Postback

The MaintainScrollPositionOnPostback page directive attribute allows pages to automatically maintain the current scroll position across postbacks. This feature is useful for large pages where scrolling is necessary to view input controls down further on the page. This works in ASP.NET 2.0 and later.

 <%@ Page MaintainScrollPositionOnPostback="true" %>

A simple but very useful feature.

Chris Pietschmann
Chris Pietschmann
Microsoft MVP | App Innovation Leader | Azure, AI & DevOps Architect | HashiCorp Ambassador | Author
I'm a Practice Leader, App Innovation specialist, solution architect, developer, SRE, trainer, and author with 25+ years of experience helping enterprises turn AI, app modernization, cloud architecture, and DevOps into real business outcomes.