Print Page | Close Window

Include file

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1733
Printed Date: 29 March 2026 at 5:17am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Include file
Posted By: eagle00789
Subject: Include file
Date Posted: 10 April 2003 at 8:53am

I have created an asp-page. that page has to be included in another asp-page. the file that has to be included needs to get some parameters. how do i do that

i tried <!--#include file="rating.asp?RatingID=1" --> but it doesn't work



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here



Replies:
Posted By: MorningZ
Date Posted: 10 April 2003 at 12:23pm
thats not possible to do...

every file has its own code, but when it comes time to run it, the server first takes all the files and dumps them into one "big" page.. then processes the script... so any include file sees the same variables, the same form items, the same URL parameters, same session, etc, etc

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: pmormr
Date Posted: 11 April 2003 at 2:59pm

speaking of that is it possible to use a variable as your include? something like

< !-- #include virtual="/mydirectory/mysubdirectory/<%myvariable%>" -->

Thanks,
Paul Morgan
Webmaster



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: MadDog
Date Posted: 11 April 2003 at 3:05pm
Originally posted by pmormr pmormr wrote:

< !-- #include virtual="/mydirectory/mysubdirectory/<%myvariable%>" -->

No. Includes are processed before asp, so that would just fail.

If you wanted to do an include with asp in it you would have to do this:
<% Server.Execute("/mydirectory/mysubdirectory/" & myvariable) %>



-------------
http://www.iportalx.net" rel="nofollow">


Posted By: eagle00789
Date Posted: 11 April 2003 at 4:22pm

what i realy want is something like

<% Server.Execute("rating.asp?RatingID=1") %>

greetings Chris



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here


Posted By: MorningZ
Date Posted: 12 April 2003 at 5:10am
you cannot do that as already said (twice)

id "Rating=1" is a URL parameter already in the address line, that either Server.Execute or <!--#include--> will have access to it...

otherwise, you'll have to give more details of your code for further help

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: eagle00789
Date Posted: 12 April 2003 at 2:41pm

what i a trying to do is to get some data from a database. the data is captured from another file. and thru the RatingID i try to get that data from that file. just look at the bottom of the post in this link for the complete code http://forums.webwiz.net/forum_posts.asp?TID=1708&PN=2 - http://forums.webwiz.net/forum_posts.asp?TID=1708&PN=2

greetings chris



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here


Posted By: TexasJoe
Date Posted: 13 April 2003 at 4:29pm

It seems like to me you could set a cookie or a session variable before you include the file.  If You can set RatingID Then call it in the include file.

Just a suggestion.



Posted By: Bunce
Date Posted: 14 April 2003 at 5:15am

Originally posted by MadDog MadDog wrote:

No. Includes are processed because asp, so that would just fail.

 HOORAY!!

;)




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net