Skip current page when using back button

T

ticars

I have a web page which all it does is redirect a user to a different
page (the page to redirect to is based on a database lookup). I want
to make it so that when a user tries to use the back button, they don't
rehit the redirect page. Is this possible? I know Response.Redirect
won't do it, I tried Server.Transfer but received errors. Any ideas?
 
R

Rutger Smit

I have a web page which all it does is redirect a user to a different
page (the page to redirect to is based on a database lookup). I want
to make it so that when a user tries to use the back button, they don't
rehit the redirect page. Is this possible? I know Response.Redirect
won't do it, I tried Server.Transfer but received errors. Any ideas?


Give the good old JavaScript a try:

<input type="button" onclick="history.go(-2);" value="Go back">

And if you want tot tackle the browser's back button: set a session
variable in the redirect page so you know that the next time (the even
times) the user comes there you redirect to another url.

//Rutger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top