2
votes

Maybe this is a bonehead question, but I cannot figure out why this is happening.

I have to make an update to an old, classic ASP web site. One of the requests was to modify the footer so that the comments and suggestions could have the emails associated with a link changed in the administration panel.

That's not the problem, the original footer used on all pages was added as...

</div>
<!--#include file="../include/footer.htm"-->
</body>

If I add enter code here

enter code here<%@LANGUAGE="VBSCRIPT" %>

to the top of the page and change the extension to either .inc or .asp, modify the original page to:

</div>
<!--#include file="../include/footer.inc"--> (or .asp)
</body>

...I get an Error 500. I've tried using the web console in the browser, but no additional info there and there is no code on the page, only the declaration that VBScript will be used. Any help would be greatly appreciated. I'm sure this is something stupid that I knew 15 years ago, but just can't remember since I haven't touched ASP since 2002.

4
It was indeed a bonehead mistake. As John pointed out below and I figured it out at the about the same time, you don't want to put a script declaration into an include file.user2229424

4 Answers

5
votes

Parent paths are disabled by default in iis 7. This means that you'll get an error if you use "../" in an include file path

http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-parent-paths-are-disabled-by-default

You could enable them in iis manager or you could use include virtual

<!--#include virtual="/root/include/footer.htm"--> 

You could also use iis manager to edit how the server handles error pages, so that you can get helpful debug text rather than just a 500 internal server error page

0
votes

first check IIS configuration

ERROR 500 causes by web server, google can found about this

0
votes

If you set it as an .asp or .inc page then I recommend you set the content of the page up like this:

<%
'code here
%>
0
votes

When you include B.asp into A.asp: also check that: B.asp not contains global variables / functions that are already declared in A.asp