ASP Include page not working

M

Mr. Analogy

Hi,

I'm trying to modularize some of my .asp scripts. So, I'd like to replace
recurring vbscript in my .asp pages with server side includes.

However, I can't get them to work. I created a simple test page (see below)
and it doesn't work. The ASP page containing the #include doesn't show any
text from teh include. However, when I view the include page (include.asp)
directly, I do see the response.write text it should be displaying.

Any suggestions? I'm baffled.



I have two files in the same directory
(http://www.BungalowSoftware.com/testdirectory/)
-include.asp
-test2.asp

include.asp
<%
Response.Write "Hello World"
%>

test2.asp
<%@ LANGUAGE="VBSCRIPT" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<body>
start test... <p> <% response.write "generated from asp on this page " %>
<p> end test</p>

<!-- #include file="include.asp" -->

</body>

</html>
 
C

Chris Leeds, MVP-FrontPage

see if you just put "hello world" on the include page with out the asp
delimiters and the response.write statement if it shows up.

that'll at least point you in a direction.

--
Chris Leeds,
Microsoft MVP-FrontPage

ContentSeed: great tool for web masters,
a fantastic convenience for site owners.
http://contentseed.com/
 
P

p c

Try the include directive w/o spaces next to --

<!--#include file="include.asp"-->

...PC
 
S

Stefan B Rusynko

Then it is not a valid ASP page or script
- the script delimiters are required around any VBscript
- Unless you mean to test it using only html on the include page as in making include.asp content just
<P>Hello World</P>

The include in test2.asp (for a file named include.asp in the same folder as test2.asp) should be

<!--- #include file = "include.asp" --->




| see if you just put "hello world" on the include page with out the asp
| delimiters and the response.write statement if it shows up.
|
| that'll at least point you in a direction.
|
| --
| Chris Leeds,
| Microsoft MVP-FrontPage
|
| ContentSeed: great tool for web masters,
| a fantastic convenience for site owners.
| http://contentseed.com/
| --
| | > Hi,
| >
| > I'm trying to modularize some of my .asp scripts. So, I'd like to replace
| > recurring vbscript in my .asp pages with server side includes.
| >
| > However, I can't get them to work. I created a simple test page (see
| below)
| > and it doesn't work. The ASP page containing the #include doesn't show any
| > text from teh include. However, when I view the include page
| (include.asp)
| > directly, I do see the response.write text it should be displaying.
| >
| > Any suggestions? I'm baffled.
| >
| >
| >
| > I have two files in the same directory
| > (http://www.BungalowSoftware.com/testdirectory/)
| > -include.asp
| > -test2.asp
| >
| > include.asp
| > <%
| > Response.Write "Hello World"
| > %>
| >
| > test2.asp
| > <%@ LANGUAGE="VBSCRIPT" %>
| > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
| > "http://www.w3.org/TR/html4/loose.dtd">
| > <html>
| > <head>
| > <body>
| > start test... <p> <% response.write "generated from asp on this page " %>
| > <p> end test</p>
| >
| > <!-- #include file="include.asp" -->
| >
| > </body>
| >
| > </html>
|
|
 
C

Chris Leeds, MVP-FrontPage

yah, that's what I meant, just have text on the file _getting_ included.
that way he can easily see if anything will come in via the SSI and point
him in a direction for a remedy.

--
Chris Leeds,
Microsoft MVP-FrontPage

ContentSeed: great tool for web masters,
a fantastic convenience for site owners.
http://contentseed.com/
--
Stefan B Rusynko said:
Then it is not a valid ASP page or script
- the script delimiters are required around any VBscript
- Unless you mean to test it using only html on the include page as in
making include.asp content just
 
M

Mr. Analogy

Changed incl page to be just text and that text doesn't show up. So incl page
not getting included.


test2 and include are in the same sub directory. Any ideas why it's not
incliuding the file?


Do i need some special code in the ,asp page to enable ssi?
Something special on the server side?



-clay
 
T

Thomas A. Rowe

Does your web host allow you to use SSI?

What OS is running on the server?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
M

Mr. Analogy

will b brief. hurt arm ystrdy.

1. SSI was not turned on at server
2. FP2003 set to not publsh comments.#include looks like comment,

Thns 4 help
 
C

Chris Leeds, MVP-FrontPage

ooh, a two part problem.
Glad you got it fixed. along that same line watch out also for "parent path
not enabled" when your include is to a directory above the pages location.

HTH

--
Chris Leeds,
Microsoft MVP-FrontPage

ContentSeed: great tool for web masters,
a fantastic convenience for site owners.
http://contentseed.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top