General discussion

Locked

VBScript + Listboxes

By DeVry Student ·
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.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VBScript + Listboxes

by Jay Eckles In reply to VBScript + Listboxes

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

Collapse -

VBScript + Listboxes

by DeVry Student In reply to VBScript + Listboxes

Poster rated this answer

Collapse -

VBScript + Listboxes

by CrshNBrn In reply to VBScript + Listboxes

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

<OPTION VALUE="<%= rstOptionBox.Fields("insertvalue").value %>"<%= selected %>/OPTION>

Collapse -

VBScript + Listboxes

by DeVry Student In reply to VBScript + Listboxes

Poster rated this answer

Collapse -

VBScript + Listboxes

by DeVry Student In reply to VBScript + Listboxes

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Forums