Home All Groups Group Topic Archive Search About

Modification by JavaScript function won't stay, why?

Author
23 Dec 2005 5:26 PM
Andrew
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.

Author
23 Dec 2005 7:36 PM
Bruce Barker
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)




Show quoteHide quote
"Andrew" <And***@discussions.microsoft.com> wrote in message
news:9C4AED5B-D0FE-430E-8E45-2BF68E84D80D@microsoft.com...
> 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.
>
>

Bookmark and Share