Link to home
Start Free TrialLog in
Avatar of cmerlo1
cmerlo1

asked on

ASP.NET AJAX Maintain page vertical scroll position after redirect

I have a search page on my site.  The user selects search criteria from cascading drop-downs, then clicks the search button and the results are displayed in a gridview on the same page.  All of this occurs inside an AJAX update panel.  When a user clicks an item in the results grid, they are redirected to a details view page.

I am using the AJAX script manager history function for storing the search info and grid page index, and this is working great- when the user clicks the browser's 'back' button, the page returns to the correct drop-down selections, results, and grid page index.

The one thing it does not do is retain the vertical scroll position of the page, so that when the user clicks the 'back' button to return to the search page, it returns to the vertical position they left it at.

This is where I need help- how can I grab the search page's vertical scroll position when the user is redirected to the details page, and restore it when the user clicks the 'back' button from the details page?
ASKER CERTIFIED SOLUTION
Avatar of Mrunal
Mrunal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cmerlo1
cmerlo1

ASKER

That did the trick!  I knew I needed Javascript- just didn't know the best way to implement it.  The cookies work perfectly.  Many thanks!