【发布时间】:2015-07-31 15:32:55
【问题描述】:
Server.Execute() 或 Transfer() 从经典 ASP 文件到物理 ASPX 页面与升级到 IIS 一起使用。
示例: 在test.asp中,
Server.Execute("/test.aspx")
但是,如果在 Web.Config 中定义了 aspx 路径以触发 dll 中的处理程序,则 Server.Execute() 和 Transfer() 在经典 ASP 文件中不起作用。
示例: 在 web.config 中
<add name="test_*" verb="*" path="test.aspx" type="testhttphandler, {fully qualified dll name}">
*请注意,在 web.config 中定义路径的方式没有任何问题。我只是想展示一个例子,我为格式道歉。
在test.asp中
Server.Execute("/test.aspx")
我收到一个错误:
Server object error 'ASP 0228 : 80004005'
Server.Execute Error
/test.asp, line 18
The call to Server.Execute failed while loading the page.
我知道有很多方法可以解决这个问题,但我想了解为什么这不起作用。我个人喜欢用最少的文件使事情尽可能简单,所以我探索了我上面探索的内容。如果您有任何见解,请告诉我。
谢谢!
【问题讨论】:
标签: asp.net asp-classic web-config