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.
-
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" />
A simple but very useful feature.
Smartnavigation =
true implemented the same feature in 1.1 frameworkSmartNavigation only had "issues" and it only worked in IE but the new MaintainScrollPositionOnPostback apparently works in most common browsers.
Caili BennettPosted Mar 3, 2017, 4:22 PM
This worked perfectly for me in all browsers, thanks!
Gakenh01Posted Jan 16, 2014, 9:30 AM
It doesn't work, except in some situations. The UpdatePanel is flawed for asyc postbacks.
Irfan HussainPosted Dec 20, 2013, 7:51 AM
I TRIED ALL THREE SOLUTIONS AND THEY NOT EFFECT ON MY PAGE .
laxman cherukuriPosted Jan 20, 2011, 5:46 AM
I TRIED ALL THREE SOLUTIONS AND THEY NOT EFFECT ON MY PAGE .
laxman cherukuriPosted Jan 20, 2011, 5:05 AM
ITS NOT WORKING IN MY APPLICATION SEND ANOTHER WAY TO DO THIS
Sandip KumbharPosted Mar 3, 2010, 1:15 AM
Thanks Yogesh, It really helped & solved the major issue in my application. Keep it up...
David LindelofPosted Aug 1, 2007, 11:35 AM
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