For Programmers: Free Programming Magazines  


Home > Archive > ASP > November 2005 > pass parameters to included files in asp









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author pass parameters to included files in asp
jacobyv@sis.unibe.ch

2005-11-26, 7:55 am

hi

i created survey.asp which displays the survey passed through the name
paramter in the url.
it works fine if i open the page like this.
http://url/survey.asp?name=survey1

but now i would like to include survey.asp in a different asp file,
let's call it main.asp, and display several surveys.

so i added the following lines to main.asp:
<!-- #include file="survey.asp?name=suvey1"-->
<!-- #include file="survey.asp?name=suvey2"-->

i get the message file not found. the webserver seems to try to open
the file "survey.asp?name=suvey1" instead of survey.asp and pass the
paramter.

it works fine when i includ like this
<!-- #include file="survey.asp-->
and open main.asp like this
http://url/main.asp?name=survey1

but this way i can only display only one survey in main.asp

is there a way to pass parameter to included files or is there another
way to include files?

thanks for your support
greetings yves

Evertjan.

2005-11-26, 7:55 am

wrote on 26 nov 2005 in microsoft.public.inetserver.asp.general:

> so i added the following lines to main.asp:
> <!-- #include file="survey.asp?name=suvey1"-->
> <!-- #include file="survey.asp?name=suvey2"-->
>


This cannot work,

because survey.asp is not executed,
only it's litteral text is added/included in main.asp
before execution of the latter,

and execution is neccessary for a querystring to have any effect.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com