Modification by JavaScript function won't stay, why?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, friends,

I have a .aspx page, which may change label text based on a user's
selection. For example, if a user select Visitor from a drop-down HTML
control, corresponding label will be changed to Visitor's Name from original
value (Member's Name) by using a JavaScript function. It worked fine.

However, if I moved to next page and then clicked Back button of IE back to
this page again, all the label text were changed back to its original value
(Member's Name in above example), although in drop-down it was still the
correct value (Visitor in above example).

Why and how to fix this problem? Any sample source code?

Thanks.
 
when the user goes back, the unchange event for the select does not fire
(because the select has a new value), so the context remains as originally
rendered. the browser only caches the original page html, and field values.

you need to add client script to do the work on page load to handle this
case.

-- bruce (sqlwork.com)
 
Back
Top