我是一名系统管理员(不是一家公司,只是为一家第三方公司工作),当我从服务器浏览他的网站时,我在服务器端收到错误消息。
Error
Active Server Pages error 'ASP 0126'
Include file not found
/login.asp, line 3
The include file '/includes/connect.asp' was not found
我在 IIS 7 中启用了父路径,但它仍然显示错误。我根本不是 ASP 人,但 IIS 中的所有东西看起来都不错。是他的代码吗?他有什么可以尝试的吗?做研究时有没有感觉这与他的文件路径有关?
谢谢大家
最佳答案
当您尝试查看在 IIS 6 中托管的 ASP 网页时,您可能会收到“ASP 0126”错误消息
请查看来自 MSDN 的这篇文章。决议就在那里。
只是为了给 Stack Overflow 带来答案。以下是解决方法。
方法一:#include 虚拟语句与绝对文件路径一起使用
要解决此问题,请在 Test.asp 网页中使用 #include 虚拟语句和绝对文件路径。考虑以下代码示例: 以下代码行不起作用。
<!-- #include virtual ="../Date.asp" -->
以下代码行有效。
<!-- #include virtual ="Samples/Includes/Date.asp" -->
方法二:#include file 语句和相对文件路径一起使用
要解决此问题,请在 Test.asp 网页中使用 #include 文件语句和相对文件路径。考虑以下代码示例: 以下代码行不起作用。
<!-- #include virtual ="../Date.asp" -->
下面的代码行确实有效。
<!-- #include file ="..\Date.asp -->
Note By default, parent paths are disabled in IIS 6. To enable parent paths, you must manually set the AspEnableParentPaths property in the metabase to TRUE.
关于iis-7 - 找不到 ASP 包含文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13112362/