Skip to main content
Known Participant
June 3, 2010
Question

Redirect when Back Button is clicked

  • June 3, 2010
  • 2 replies
  • 1047 views

I have 4 pages in my application:

Page1.asp (form page using the POST Method)

Page2.asp (Insert to Database script + Redirect to Page3.asp)

Page3.asp (Page displaying the the confirmation of insertion)

The problem I'm facing is that once on Page3.asp (confirmation page), if the user hits the Back Button, it brings him back to Page1.asp with the form already filled with data previously entered. Eventually, the data can be inserted twice.

Is there a way to redirect the user to say Page4.asp when clicking the back button from Page3.asp?

This topic has been closed for replies.

2 replies

Participating Frequently
June 5, 2010

clear all inputs everytime the page is loaded,

June 4, 2010

Declare a session variable on page 2 and add a conditional if/else region on page 1 where if session is set then show alternative content else display form.

You can have the entire application on one page using the method mentioned where if post or session variable isset then display confirmation message else display form.

BracholeAuthor
Known Participant
June 4, 2010

I tried that but when the user clicks the Bak Button from the Browser, it doesn't see the Session Variable right away, unless the page refreshes. Is there a way to refresh that page when the user clicks the Back Button?

June 4, 2010

Sorry I can't help because a simplified version of your code example did not display correctly in your post!!!