我正在尝试映射由 .net 处理的经典 asp 页面的请求,以便它通过自定义 httpmodule 运行。
在 IIS 中,我已将 asp 请求重新映射到 aspnet_isapi.dll - 我确定我做对了
现在在我的测试应用程序中,我收到此错误:
Server Error in '/TestASPRedirect' Application.
--------------------------------------------------------------------------------
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.asp' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /testaspredirect/test.asp
在线搜索此错误显示有很多人在使用 cassini 时遇到问题,但这并不是真正相关的,我正在 XP 开发机器上的 IIS 5.1 上对此进行测试,并且在 IIS6 上进行了测试,也遇到了相同的错误。
我已按照说明添加和注册 httphandler(请参阅 http://support.microsoft.com/default.aspx?scid=kb;en-us;Q308001 ),但我不知道在 ProcessRequest 例程中放置什么以确保请求得到传递。什么是默认的 .net httphandler,我可以在 web.config 中映射到它吗?:所以像:
<httpHandlers>
<add verb="*" path="*.asp" type="standard.nethttphandler"/>
</httpHandlers>
我如何告诉 asp.net 它需要传递 ASP 请求而不是阻止?
最佳答案
其实你离成功只有一步之遥。将以下部分添加到您的本地网站(或虚拟目录)web.config 文件中:
<configuration>
...
<system.web>
<compilation>
<buildProviders>
<add extension=".asp" type="System.Web.Compilation.PageBuildProvider"/>
</buildProviders>
</compilation>
<httpHandlers>
<add path="*.asp" verb="*" type="System.Web.UI.PageHandlerFactory" validate="true"/>
</httpHandlers>
</system.web>
关于asp.net - 在 IIS 中将经典的 asp 页面映射到 .net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1572746/