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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with includes

Status
Not open for further replies.

MinnisotaFreezing

Programmer
Jun 21, 2001
120
0
0
KR
Can anyone help me with this?

This is one file(index.aspx):

<!-- #include file = &quot;test.aspx&quot; -->
Chris
Response.Write(Name)

This is the other file(test.aspx)
<%
Response.Write (&quot;Test&quot;)
Name = &quot;Paul&quot;
%>

When I load index.aspx all I see is Chris.

However, when I run this on my test server, it works like I would guess, and shows Test Chris and Paul.

I am absolutly certain the files are in the same directory, so they should work. I don't have access to the server, but other pages in the parent directory have includes in them, so I assume includes are turned &quot;on&quot;

Any ideas or hints are appriciated.
 
Are index.aspx and test.aspx in the same folder? That is the only way your code will work. If they are in different folders you need to modify your <!-- #include > element

-pete
 
Hmm, I'm having a similar problem, is there anything that can prevent this from working (assuming spelling and file locations are correct) other than the server not supporting SSI ?

This post is best viewed at 1024 x 768
 
i think the includes are done the same way, but in regards to programming in aspx i believe if it's a resource/code component of the aspx it should be includeded via

<%@ Page Language=&quot;vb&quot; AutoEventWireup=&quot;false&quot; Codebehind=&quot;index.aspx.vb&quot; Inherits=&quot;WebApplication1.WebForm1&quot;%>

along those lines
 
also the code supplied i'm assuming is not copy pasted, but if it is, you seem to have your include within the <% %> tags
 
Thanks for fast responses, I'm positive the files are in the same folder, and my include is outside of the <% %>, that was a sloppy post on my part.

&quot;Hmm, I'm having a similar problem, is there anything that can prevent this from working (assuming spelling and file locations are correct) other than the server not supporting SSI ? &quot;


This is kind of what I am thinking. Is it possible for SSI to be turned on for certain folders only? Also, SSI should work if aspx is being parsed, it should be parsed as an include, right?

Thanks again

CJB
 
You could test whether SSI was enabled or not by changing the line in the main page to look for a file that you know doesn't exist:

Code:
<!-- #include file=&quot;xyz.abc&quot; -->

If SSI is enabled you should get an error saying it couldn't find the file. If it's not enabled, the page will just load normally with no errors (but with nothing included obviously!)

--James
 
Have you tried Server.Transfer(yourfilename)
it maybe an idea even though it os not used for what your doing

ooooooooooooooooooooooooh bugger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top