user2229424
user2229424

Reputation: 25

Include File causing Error 500 in Classic ASP

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.

Upvotes: 2

Views: 8307

Answers (4)

Mercury
Mercury

Reputation: 7988

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

Upvotes: 0

ScotterMonkey
ScotterMonkey

Reputation: 1044

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
%>

Upvotes: 0

John
John

Reputation: 4638

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

Upvotes: 6

mrsnax
mrsnax

Reputation: 9

first check IIS configuration

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

Upvotes: 0

Related Questions