Archive for July, 2010
An easy way to maintain the current scroll position across postbacks in ASP.NET is to use the MaintainScrollPositionOnPostback page directive attribute. This is useful if you are working on big pages where scrolling is necessary, and works in most common browsers.
There are three ways of applying the property to a web page.
- You can set it programmatically
Page.MaintainScrollPositionOnPostBack = true;
- In the page declaration
<%@ Page MaintainScrollPositionOnPostback=”true” %>
- Or in the web.configs <system.web> section.
<pages maintainScrollPositionOnPostBack=”true” />