Monday, September 28, 2009

Maintain Scroll Position on PostBack in ASP.NET

In order to maintain the page scroll position after the page gets postback, ASP.NET gives us three methods. They are:


1. In Web.config :
<pages maintainScrollPositionOnPostBack="true">

2. In single Page :
<%@ Page MaintainScrollPositionOnPostback="true" ...

3. Programatically :

Page.MaintainScrollPositionOnPostBack = true;

Labels: , , , , , ,