Maintaining the Scroll Position after post back

July 18, 2006 at 12:09 pm 9 comments

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

Advertisements

Entry filed under: ASP.NET Tips.

Sending Emails from ASP.NET 2.0 Page post back after JavaScript code executed on server control click

9 Comments Add your own

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

    Reply
  • 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

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

    Thank You

    Reply
  • 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

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

    Maintaining the Scroll Position after post back

    Good..

    Thanks A Lot !

    Reply
  • 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?

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

    #comment-2390

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

    Thank a lot your code is usefull for me

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

    good work

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Top Clicks

  • None

Calendar

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

Recent Posts

Feeds

Blog Stats

  • 93,152 hits

%d bloggers like this: