How to "snap back" to a position on a page

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have a page that displays a datalist of multiple data items. In
each dataitem I have gridviews that are pagable. It looks simular as
I show below. I just want a way of hitting the gridview paging number
on an item not to cause the page to snap back to the top of the page.
Rather I would want it to stay exactly where it's at. Is there
something I can put in the code behind (C#) in pageload that will say
snap back to where I was? Thanks
___________________________________
| ... |
| ... |
| ... |
| ... |
| _____ |
| _____ |
| _____ |
| _____ |
| _____ |
| _____ |
| 1 2 3 |
-------------------------------------------------------------
| ... |
| ... |
| ... |
| ... |
| _____ |
| _____ |
| _____ |
| _____ |
| _____ |
| _____ |
| 1 2 3 |
-------------------------------------------------------------
 
If you mean to maintain the same scroll position, the Page directive has a
Boolean property called MaintainScrollPositionOnPostback which does what it
sounds like you want. Try this and see if it is what you are looking for.
 
Back
Top