View Single Post
  #2  
Old 07-23-2007, 11:40 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 632
oxygen is on a distinguished road
Default Re: ASP.NET FAQ - maintain page scroll position after a page postback?

Say you've got some really long page, perhaps with some huge Control -- like, say, a huge, edit-enabled GridView. Someone clicks a link halfway down that page (like, say, the "Edit" link on one of the later entries in that huge GridView). It generates a postback, and the page get refreshed to its *top* instead of half-way down.
If you want, instead, to maintain the page scroll on a postback, just set the MaintainScrollPositionOnPostback property on the Page. You can do this declaratively (in your aspx Page directive) like so:

<%@ Page MaintainScrollPositionOnPostback="true" ... %>
Reply With Quote