Maintaining the Scroll Position after post back

July 18, 2006

Some of us may come across this situation, ie maintaining the scroll position after the page is post back. This is very useful when we have a gridview or data repeater or some thing like that, which shows a large amount of data and a button controls is place below page, so that user has to scroll a bit to reach there. After clicking on the button, the page is posted back, but the page is scrolled to top.

If you want to maintain the scroll position, add this attribute on the @page directive

<%@ Page Language=”VB” MaintainScrollPositionOnPostback=”true”

Hope this will help you

Entry Filed under: ASP.NET Tips. .

9 Comments Add your own

  • [...] Original post by Rajeesh and software by Elliott Back ASP.NET Tips» [...]

  • 2. Mihai  |  December 12, 2006 at 3:12 pm

    Unfortunately that doesn’t seem to work if an Atlas ScriptManager is present in the page. I was looking for a solution to maintain the scroll position in an Atlas-enabled page… I would greatly appreciate if anyone would share a solution or workaround.

    Thanks

  • 3. Alex  |  June 10, 2007 at 1:36 pm

    Thank You

  • 4. GoGolfer  |  July 12, 2007 at 4:31 pm

    Hello Everyone,

    I am a golfer myself and I like to play whenever I get a chance.
    A short while ago, a very good friend of mine told me about a great golfing equipment and accessories website that has discounted prices on all their products, same day shipping in most cases and there is no state sales tax, they are paying that.
    So if any golfer here is ready to save some money on quality products at highly discounted prices, you might want to check out their site at; http://hoffmangolf.com

  • 5. Bala  |  August 15, 2007 at 12:50 pm

    Maintaining the Scroll Position after post back

    Good..

    Thanks A Lot !

  • 6. ankur  |  February 23, 2008 at 10:46 am

    am working on asp/html..developing a blog..what am looking for is..once an user submis the message (ie the post), the scroll should be maintained and the user shouldn’t be taken to the top of the page..is it possible in ASP 3.0?

  • 7. ankur  |  February 23, 2008 at 10:47 am

    #comment-2390

  • 8. pp  |  August 27, 2008 at 10:59 am

    Thank a lot your code is usefull for me

  • 9. ramesh  |  September 11, 2008 at 9:22 am

    good work

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Top Posts

Top Clicks

Calendar

July 2006
M T W T F S S
    Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Tags

ASP.NET ASP.NET Tips WPF WPF Blog WPF Controls WPF thirdparty controls

a

Recent Posts

2

Fav links

Feeds

Blog Stats