HOW TO: Retain Scroll Position over Postbacks
Solution
Solution 1: Turn on ASP.NET SmartNavigation feature.
- How
to Enable SmartNavigation by Sriram V (DotNetJunkies) - the standard ASP.NET way
of maintaining scroll position over postbacks; works only with IE 5.5 or later.
Solution 2: Write or use a custom server control to emit client Javascript
code to save and restore scroll position.
- Keeping Scroll Position over
post Backs by Justin Lowell (ASPAlliance.com) - includes code tutorial; unlike
SmartNavigation, this replacement solution works with most browsers and formats the
page correctly under most scenarios.
Related Resources