Discussion Locked

VBScript + Listboxes

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Here is my problem: I have an ASP returning a web page with 4 different drop down lists (don't let the dummies type anything in, ya know). The choice in the first list box determines the values in the other three, however when I click my BACK or FORWARD button on the browser, the page doesn't reload with the correct data. It selects the first list box, with the wrong data in the other three. Is there a way to refresh the page when it is moved onto using the BACK or FORWARD buttons? Thank you for your help.

5 replies

by jay eckles

There's no way to tell if a user came to your page using "Back" or "Forward" buttons, but there are a couple of things you can do.

1. Check the HTTP_Referer server variable. If it is NOT the page that is "supposed" to be previous to the page you're generating, then do something like re-process the lists.

2. Set the pages to expire quickly. That will "force" the browser to return to the server for the page, and then you can process it properly. There's a lot of debate about if there is a right way to do this and if so what that right way is, but you should basically send Cache-control and Expires headers before you send your content. Take a quick look at the HTTP specs. You might find that adding some http-equiv meta tags will help control "rogue" browsers.

Good luck.

Jay Eckles
www.jayeckles.com

by crshnbrn

A good link for Expiration issues in ASP
http://www.learnasp.com/learn/cachenomore.asp

You should be able to set the correct choice by using ASP

requestvalue = Request("value")

If requestvalue = rstOptionBox.Fields("insertvalue").value then
selected = " SELECTED"
Else
selected = ""
End If

"<%= selected %>>

This discussion is closed to new replies.