Javascript label change with browser back button

  • Thread starter Thread starter Dot net work
  • Start date Start date
D

Dot net work

Hello.

I have an aspx page that changes an HTML label's text using
javascript.

After the label's text has been changed in this way, I redirect to
another aspx page.

If I then use the back button on the browser, the label has lost it's
newly changed value.

Do you know how I can make sure that the label doesn't lose it's
changed value when I click the back button?

TIA.

-dnw.
 
You want to make sure your page is not cached.
When the back button is clicked you want your page to be requested from the
server again so you can ensure the correct label is output.
By disabling caching for your page, this should solve the problem in most
cases.
Try some code like this:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
 
Hi,

Sorry, but I think this is the opposite of what my question asked for.

If a label gets changed using javascript, and then the user redirects
somewhere else, if the user then clicks the back button on the browser
bar, I need the label to display/remember the *new* value, and not be
reset back to the original value.

Thanks,
-dnw.
 
Back
Top