views:

2209

answers:

2

SYMPTOM:

I have Test_virtual.asp with the following:

<body>&nbsp;
included content starts here:
<!--#include virtual="/test_included.txt"-->
</body>

test_included.txt contains only:

This is the included file

When I browse to test_virtual.asp, I don't see the included file's text.

POSSIBLE CAUSES
I found one report that indicated the Includes are disabled by default in II7: http://tech.mikeal.com/blog1.php/2008/08/05/server-side-includes-for-html-in-iis7

But the instructions assume you have access to the actual machine's control panel.

A: 

Try using file instead of virtual:

<!--#include file="../test_included.txt"-->

or

<!--#include file="test_included.txt"-->

depending on where your file is.

I'm also assuming classic ASP support has been enabled for your IIS7 server as I'm pretty sure it isn't there by default.

Can you see the directive when you view source in the browser? That might tell you if it is being ignored or if it is just failing.

Bert Lamb
I tried the file="" already (both ways, thinking that maybe the 'server root" wasn't the same as the www root) and got the same results.the directive <!-- --> does not appear in the .asp page when I browse to it. So it's falling out completely.
Clay Nichols
+1  A: 

More info: it looks like the issue is that Includes are disabled by default. I figured out that I can get to the Handler Setting in the IIS7 Manager but it's telling me that I have to manage them direclty in the config file b/c the site is in a shared app pool running in Classsic mode.

How many programmers does it take to fix this problem? None. It's a an IT problem.

Clay Nichols