Click to See Complete Forum and Search --> : [02/03] Save Scrollbar Position


RobDog888
October 9th, 2006, 03:27 AM
I have seen and used the htc solution for DIVs overflow types of scrollbars but I need the whole page to retain its browser's scrollbar position during a postback.

Of course this is for IE but if it works for FF then thats ok too. :D


Thanks

HairyMonkeyMan
October 10th, 2006, 04:16 AM
Just recently figured this one out myself. In your page declaration put this:

<%@ Page MaintainScrollPositionOnPostback="true"

Hope this helps ;)

Shuja Ali
October 10th, 2006, 04:53 AM
Remember this is only available in 2.0 version, however this statement just renders the required javascript on the page which allows it to maintain the scroll position on the postback.

There is no rocket science involved, a simple javascript in 1.1 will be able to do that same thing.

This link will show you how to do it
http://aspnet.4guysfromrolla.com/articles/111704-1.aspx

RobDog888
October 10th, 2006, 02:36 PM
Thanks Shuja Ali.

I like the the ease of it being placed in a control. :)

ahmad.i.elkhatib
May 3rd, 2011, 06:14 AM
Just recently figured this one out myself. In your page declaration put this:

<%@ Page MaintainScrollPositionOnPostback="true"

Hope this helps ;)

So many thanks, this was helpful.

Best Regards,
Ahmad

GremlinSA
May 3rd, 2011, 06:24 AM
Hi Ahmad...

Glad that this old info was helpful, In future please do not reply to 5 year old posts..