Passing variable to an include via URL query string - a problemo

J

John Aspinall

Hi,

Ive got a navigation bar for my web pages in an include (top_nav.asp).

On my homepage (index.asp) and all the other site pages I have a
reference to this include which includes my navigation bar in each
page.

<!--#include virtual="/includes/nav/top_nav.asp"-->

My problem is, is that I need to pass a URL querystring variable to
the top_nav.asp page. Im using this variable in Case statement to
highlight a table cell a different colour to indicate which bit of the
site they are in

I can do this fine with this <a
href="/content/table.asp?tab=table">Table</a>, but however this will
obviously only load the Nav Bar include page, and not the whole page.
When I point it the the index page <a
href="/content/index.asp?tab=table">Index</a>, the nav bar page does
not load correctly, its as if the include isnt seeing the querystring
variable.

Help!!!
 
T

Turkbear

Hi,

Ive got a navigation bar for my web pages in an include (top_nav.asp).

On my homepage (index.asp) and all the other site pages I have a
reference to this include which includes my navigation bar in each
page.

<!--#include virtual="/includes/nav/top_nav.asp"-->

My problem is, is that I need to pass a URL querystring variable to
the top_nav.asp page. Im using this variable in Case statement to
highlight a table cell a different colour to indicate which bit of the
site they are in

I can do this fine with this <a
href="/content/table.asp?tab=table">Table</a>, but however this will
obviously only load the Nav Bar include page, and not the whole page.
When I point it the the index page <a
href="/content/index.asp?tab=table">Index</a>, the nav bar page does
not load correctly, its as if the include isnt seeing the querystring
variable.

Help!!!
IIRC,
All Includes are loaded BEFORE any code is interpreted, so your querystring variable is probably not seen by the
include file at the time it loads.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top