p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

proasp_codeclinic thread: Conditional Includes?

Message #1 by jvong@b... on Thu, 23 Mar 2000 23:12:57
No you cannot....

When the server decides to begin parsing a page it logically sticks all of
the code of that include file where you have written it...as if you had
actually written it there. From your example below, it should be making that
if then elseif statement into one huge statement as if all of the code in
those include files were actually written into place. Now if you write those
include files in such a way that they work like that...

-----Original Message-----
From: jvong@b... 
Sent: Thursday, March 23, 2000 11:13 PM
To: Code Clinic
Subject: [proasp_codeclinic] Conditional Includes?

Does anybody know if there's a way to do conditional Server Side Includes?

' Headers and stuff go here, etc...

<% if request.form("Add") then %>
      <!-- #include file="addjob.htm" -->
<%   elseif request.form("Delete") then %>
      <!-- #include file="deletejob.htm" -->
<%   elseif request.form("Edit") then %>
      <!-- #include file="editjob.htm" -->
<% end if%>

' Page footers go here, etc...

I'm aware that this method doesn't work, but does anybody know how to do
this the right way or something similar to this?

You are currently subscribed to proasp_codeclinic.

  Return to Index