SIGN UP MEMBER LOGIN:    
ARTICLE

Maintain Scroll Position on Postback in ASP.NET 2.0

Posted by Yogesh Verma Articles | How do I January 01, 2007
This article shows how to allows pages to automatically maintain the current scroll position across postbacks.
Reader Level:

This article shows how to allows pages to automatically maintain the current scroll position across postbacks.

The MaintainScrollPositionOnPostback page directive attribute allows to do that.

This feature is useful for large pages where scrolling is necessary to view input controls down further on the page.

There are three ways of applying the property to a web page.

  1. You can set it programmatically

    Page.MaintainScrollPositionOnPostBack = true;
  2. In the page declaration

    <%@ Page MaintainScrollPositionOnPostback="true" %>
  3. Or in the web.configs <system.web> section.

    <pages maintainScrollPositionOnPostBack="true" />
This feature is an absolute must-have on large web pages built for postback scenarios.

A simple but very useful feature.

Smartnavigation = true  implemented the same feature in 1.1 framework 

SmartNavigation only had "issues" and it only worked in IE but the new MaintainScrollPositionOnPostback apparently works in most common browsers. 

Login to add your contents and source code to this article
share this article :
post comment
 

I TRIED ALL THREE SOLUTIONS AND THEY NOT EFFECT ON MY PAGE .

Posted by laxman cherukuri Jan 20, 2011

ITS NOT WORKING IN MY APPLICATION SEND ANOTHER WAY TO DO THIS

Posted by laxman cherukuri Jan 20, 2011

Thanks Yogesh,
It really helped & solved the major issue in my application.
Keep it up...

Posted by Sandip Kumbhar Mar 03, 2010

I tried all three solutions (not collectively) and they had not effect on my page. Microsoft's forum recommended thee same thing a couple of months ago and I didn't work then either. I using Visual Web Developer...don't know if that has any bearing. Thanks, David

Posted by David Lindelof Aug 01, 2007
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Become a Sponsor