I'm trying to understand ASP but #include
doesn't seem to work for some reason. I'm using IIS 7.5 (included with Win 7).
I have two .asp files in .../wwwroot/MyWeb/
. I'm trying to #include FiboRecursive.asp
in a file called test.asp
. Both files work separately if I remove the #include
. I have tried both virtual and file includes.
This is test.asp:
<%@ language="javascript" %>
<html>
<body>
<p>
<% //Response.Write(Request.ServerVariables("http_user_agent"));%>
</p>
<p>
<%
var remoteAddr = Request.ServerVariables("REMOTE_ADDR");
remoteAddr += "";
if ((remoteAddr.length > 5) && (remoteAddr.substr(0,7)=="140.114") ) {
Response.Write("Hello there Tsingda student!");
}
else {
Response.Write("You're not a Tsingda student!");
}
%>
</p>
<form action="./FiboRecursive.asp" method="post">
<input type="submit" value="Calculate Fibonacci numbers!" />
</form>
<!--#INCLUDE FILE="fiborecursive.asp" -->
</body>
</html>
This is the code in FiboRecursive.asp:
<%@ language="javascript" %>
<%
Response.Write("Let's calculate some Fibonacci numbers!");
%>
Edit: Another thing: I always use web developer tools (error console) in Firefox to check for errors in my code, but obviously that doesn't work too well when doing server side stuff. Any way to get some hints as to what's wrong from a console or similar?