Back button vs <a href to return to previous page

J

jimt

I have a ASP page with a form on it that hides some variables and the action
goes to another ASP page. The first lines of code on the second page is to
get the variables from the first page form that is used to set up the initial
data displayed on the second page. The second ASP page has multiple forms
with hidden variables used throughout the page. The action for these forms
"re-calls" the second page and the hidden variables to requery the database
table and display the new data.

Everything worked fine when I used the back button to exit the second page
and return to the first page. I added a <a href > link on the 2nd page to
return to the first page. If I use this hyperlink to return to the first page
and then use the form on the first page to go to the second page, my coding
doesn't work (empty/null variables associated with the forms on the second
page causing a SQL Select error).

What does the back button do compared to a hyperlink? Do I need to have the
have the hyperlink call a ASP page with coding to reset some values?

Thanks
Jim T.
 
P

p c

Web pages by themselves do not maintain state. When you click the Back
icon (or use history effect in script to go back), you are going to a
previously page viewed by the browser. That page is the cached page on
your machine unless, you set it to expire.

If the (previous page) needs data to function correctly, you ned to pass
the data back to it and relad it. You can do that whith a hypelink that
passes the needed parameter/data pairs, a form that passes the needed
parameter/data, or have the "back page relad and re-read the needed data
fromm session variables or cookies.

...PC
 

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

Similar Threads


Top