Forum Moderators: phranque

Message Too Old, No Replies

ASP help

redirecting code.

         

geoapa

10:33 pm on Jan 11, 2004 (gmt 0)

10+ Year Member



Hi, I have 2 pull-down menus and I'm trying to code an ASP script that will do the following...

if a selection was made from the first pull-down menu, do the following..
[code]
else if a selection was made from the second pull-down menu, do the following..
[code]

My script works with just one pull-down menu, but I don't quite know how to code the second one in. Right now each pull-down menu is in it's own form. When a selection is made, the onChange event is triggered which should reload the page with the relevant information that was made.

I was think of adding something like "index.asp?page=1" to the first form's action parameter and "index.asp?page=2" to the second form's action parameter, but then how do I script the logic so that I can direct the flow of my code?

here's my train of thought in pseudo-code...

if a selection was made from the first pull-down menu (if page ==1?)
[do this code]
if a selection was made from the second pull-down menu (if page ==2?)
[do this code]

geoapa

10:48 pm on Jan 11, 2004 (gmt 0)

10+ Year Member



Let me answer my own question.

After a little more research, I learned about the Request() function.
I used Request("Page") to grab the value of the Page that was passed and then coded a couple if statements to test the value and direct the flow of the code accordingly.

Dreamquick

8:41 pm on Jan 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll find it's a little more efficient to use Request.Querystring("Page") since then you narrow the scope of the search down to just the querystring collection rather than every possible collection the Request object holds which makes for faster code and a happier server.

- tony