Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maintain scroll positions on ALL pages

Status
Not open for further replies.

Glowworm27

Programmer
May 30, 2003
587
US
I have a need to keep the scroll positions of each page in my website. all i have been able to find are scroll back posistions on postbacks.

I have several pages with large grids, and the users would like to be able to go back and forth and stay at their current scroll position on each page .

So on page A there scroll position is on row 200 of a grid, then they got to page B and scroll to row 350. And when they go to PAge C they scroll only to row 10.

Now when they go back to page A they want the scroll position back at row 200, and so on...

I am thinking cookies but cannot find a good solution yet.

Thanks
G

George Oakes
CEO & President
COPS Software, Inc.

Programmer & Developer
.Net, WSS 3.0, SQL DBA
Check out this awsome .Net Resource!
 
in your page directive use MaintainScrollPositionOnPostback="true"

Ordinary Programmer
 
That is with VS2005 and greater.

Ordinary Programmer
 
So on page A there scroll position is on row 200 of a grid, then they got to page B and scroll to row 350.
that's too much data per page. i would implement a paging solution (not the default gridview paging). Not only will it be easier to manage, you will get better response times from the webpage as much less data is queried from the database and rendered on screen.

You will still have the issue of holding a subset of records between webpages. But this could be stored in either a cookie or session.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Jason is correct, this is way too much data to display to the user not matter if they say that is what they want. Especially if you are going to be pulling the data each time the page is hit.

To hold the scroll position, you will have to use javascript, you can ask how in that forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top