Remember vertical scroll position after redirect
Posted on 2006-10-31
I'm developing a dynamic photo gallery.
The admin section features a listings page featuring a table listing rows and rows of thumbnails. Next to these thumbnails, there are icons for editing, deleting and sorting each image.
The icons are basically page links that forward the picture's Id number to other asp pages.
In this example, there is a button next to the thumbnail that moves the image's sorting position up by one.
<a href="move_up.asp?id=<%=rs("id")%>"><img src="images/arrow_up.gif" border="0"></a>
When I click the UP button, I'm taken to move_up.asp where after the script it executed I'm redirected back to the image listings page.
The problem is that there might be at least 50 thumbnails in a list making the page very long and if I want to keep moving a particular image up that is near the bottom, I have to scroll down for ages in order to find it each time.
I need a way to capture the page's vertical scroll position and either save it as a cookie, session variable or preferably send it as a parameter along with the querystring to the move_up.asp page, bring it back again when I'm redirected back to the listing page to be used to take me back to the position of the page I was at before.
I'm using classic ASP so I don't have the luxury of SmartNavigation.
Thanks in advance.