Maintain Scroll Position on Postback in ASP.NET
2
Jul
Posted by admin as ASP.NET
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” />
This entry was posted
on Friday, July 2nd, 2010 at 9:12 am and is filed under ASP.NET.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.