Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include files

Status
Not open for further replies.

timcadieux

Programmer
May 25, 2005
129
BE
Argh, can someone tell me why this script appears to be trying to load both inlcudes, i get name Redefined errors.

Code:
<!--#include file="../Scripts/setup.asp" -->
<% IF DWAN_dude = "true" then %>
	<!--#include file="6_1_DWAN_inc.asp" -->
<% ELSE %>
	<!--#include file="6_1_inc.asp" -->
<% END IF %>
 
how about this...

<% IF not(DWAN_dude) then %>
<!--#include file="6_1_inc.asp" -->
<% ELSE %>
<!--#include file="6_1_DWAN_inc.asp" -->
<% END IF %>

-DNG


 
ok ok...i think Tony is right...i just got my thoughts mixed up with dynamic include files...

we can have dynamic include files...is that right Tony??

-DNG
 
Unfortunately not :(

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 

Include files are included before the ASP script is executed - therefore all the contents of both include files will be included in the overall ASP script, placed where they are written in the code.

Do a search on 'dynamic includes' or just 'includes' on this forum and you should find a lot of discussion on the matter. There may also be an FAQ. You can google for it aswell.

There are ways to dynamically include scripts, such as Server.Execute(), execute()/fso etc - each has benefits and drawbacks.

Hope that helps..

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top