Reputation: 3615
I want to maintain the Scroll Position between two pages. I have a Page A which has many reports, when user clicks a report, user will be redirected to Page B where the report will be opened to make the changes. After submitting changes, user will be redirected to Page A. Here the problem is, showing the top of the page but I want to show the page at the previous position.
I have tried using this.MaintainScrollPositionOnPostBack = true; but this is working only on the same page but not between the different pages.
I really need to fix this, please give me your thoughts...
Upvotes: 0
Views: 838
Reputation: 4214
The simplest thing to do is probably give every link/report on page A an anchor.
So, for each report you would hide an id
attribute somewhere - say the title, so it would be something like <h3 id="report42">Report 42</h3>
. Then when you go back from page B, instead of going to www.example.com/pageA.html
, you go to www.example.com/pageA.html#report42
. This will open the page with the scrollbar at wherever the report42
id is found.
Upvotes: 1