Quick Newbie Question

G

Guest

Hi All!
I have a.aspx with a text field, I can put a value in the text field. Now
when I go to b.aspx through a response.redirect, that's fine.
Now when I hit the back button on the browser, my value stays in the text
field.
But if I use a Response.redirect command, my text field go blank. How can I
create a button on my form that does the same as the back browser button. I
would like the value to stick. And what is the diffrence between a click on
the back browser, and the other way.

As Always, Thanks!

Rudy
 
S

Scott M.

The reason the value is there when you hit "Back" is because the page is not
being processed again, the page you see is the browser's cached version of
the page. You may see a value in the textbox, but the server is completely
done with the page and doesn't know anything about the textbox at this
point.

You could add this, which would simulate what the Back button does:

<INPUT TYPE="Button" VALUE="Go Back" OnClick="history.back(1)">

But again, the user will not be re-processing the page with this, only
seeing the cached version.
 
G

Guest

Thanks Scott! Just what I needed!

Rudy

Scott M. said:
The reason the value is there when you hit "Back" is because the page is not
being processed again, the page you see is the browser's cached version of
the page. You may see a value in the textbox, but the server is completely
done with the page and doesn't know anything about the textbox at this
point.

You could add this, which would simulate what the Back button does:

<INPUT TYPE="Button" VALUE="Go Back" OnClick="history.back(1)">

But again, the user will not be re-processing the page with this, only
seeing the cached version.
 

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,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top