By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,917 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,917 IT Pros & Developers. It's quick & easy.

Maintain scroll postion on page return.

P: 30
Hello,

I have slight delima and not sure how to go about this.

When a user clicks a link it brings them to a new page, when they have done what the need to do there is a link on that page to bring back to the original page that they were on.

My question is.

How can i retain the origianal scroll position that the user had on that page?

Any insight one can provide would be much apreciated.

B.
Jan 3 '08 #1
Share this Question
Share on Google+
5 Replies


jhardman
Expert 2.5K+
P: 3,405
Does the link use an actual reference to the previous page, or the "back" command?

Jared
Jan 3 '08 #2

P: 30
Does the link use an actual reference to the previous page, or the "back" command?

Jared
refernce

<a href="<%=strBaseURL & "&content=summary" & strBaseQueryString & "&vol=" & strVol & "&cat=" & strCat %>">
Jan 3 '08 #3

jhardman
Expert 2.5K+
P: 3,405
try using javascript to go back. I'm not sure it will solve the problem, but it is the next thing I would try.
Expand|Select|Wrap|Line Numbers
  1.  <input type="button" value="Back to Previous Page"
  2. onClick="javascript: history.go(-1)">
The onclick statement can of course be put in any clickable element. Let me know if this works.

Jared
Jan 4 '08 #4

P: 30
Yeah i tried that. works well if it was a straight page to page.

The other problem i forgot about is that when a user visits the page and selects what they want to view/e-mail to themselves it brings them to a forum to fill out. they only have to do this once, but every time they visit the site (completely close and repoen the browser). so i need a work around for the cookies aspect of the site :(
Jan 4 '08 #5

jhardman
Expert 2.5K+
P: 3,405
I'm not sure I understand. Are you saying the first problem was solved? If yes, then congrats.

The second problem? I don't get it at all. You want users to only need to log in once? Then you just need to save cookies with the log in info, and have the login page read the cookies, if the user is accepted he/she should be forwarded on, otherwise send the user the login form. Let me know if this makes sense.

Jared
Jan 4 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.