473,327 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Javascript label change with browser back button

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.
Nov 18 '05 #1
3 2380
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")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Dot net work" <do***@hotmail.com> wrote in message
news:77*************************@posting.google.co m...
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.

Nov 18 '05 #2
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.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message news:<ec**************@tk2msftngp13.phx.gbl>...
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")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Dot net work" <do***@hotmail.com> wrote in message
news:77*************************@posting.google.co m...
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.

Nov 18 '05 #3
I needed to use a session cookie.
-dnw.

do***@hotmail.com (Dot net work) wrote in message news:<77*************************@posting.google.c om>...
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.

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dot net work | last post by:
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.