在 IIS 中将经典 asp 页面映射到 .net
我正在尝试映射对经典 asp 页面的请求以由 .net 处理,以便它通过自定义 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 请求而不是阻止?
I'm trying to map requests for classic asp pages to be handled by .net, so that it runs through a custom httpmodule.
In IIS I have remapped asp requests to aspnet_isapi.dll - I'm sure I've done this bit right
Now in my test app I am getting this error:
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
Searching online for this error shows a load of people having problems with cassini, but this is not really relevant, I am testing this on both IIS 5.1 on XP dev machine, and have tested on IIS6 also getting the same error.
I have followed instructions for adding and registering a httphandler (see http://support.microsoft.com/default.aspx?scid=kb;en-us;Q308001), but I don't know what to put in the ProcessRequest routine to ensure the request gets passed on. What is the default .net httphandler, can I just map to this in web.config?: so something like:
<httpHandlers>
<add verb="*" path="*.asp" type="standard.nethttphandler"/>
</httpHandlers>
How do I tell asp.net that it needs to pass ASP requests on and not block?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
其实你离成功只有一步之遥。将以下部分添加到本地网站(或虚拟目录)web.config 文件中:
Actually you are only one step far from the success. Adding following section to your Local website(or virtual directory) web.config file:
看起来
.asp
扩展名已映射到HttpForbiddenHandler
。如果您使用的是 ASP.NET 1.1,请打开以下文件:
如果您使用的是 ASP.NET 2.0,请打开此文件:
搜索“
path="*.asp"
”,然后注释掉线。它会像这样:It looks like the
.asp
extension is mapped to theHttpForbiddenHandler
.If you're using ASP.NET 1.1 then open the following file:
If you're using ASP.NET 2.0 then open this file:
Search for "
path="*.asp"
", then comment out that line. It'll like something like:找到以下文件:
C:\WINDOWS\MICROSOFT.NET\FRAMEWORK\\Config\web.config
,其中
是文件夹名称:open在 XML 编辑器中..(甚至记事本也可以)
并添加以下行:
在下面的 XPath:
configuration/system.web/httpHandlers
下替换现有的!
添加以下行:
在下面的 XPath 下:
对我来说就像 gem 一样:)
Locate the below file:
C:\WINDOWS\MICROSOFT.NET\FRAMEWORK\<FramworkVersion>\Config\web.config
where
<FramworkVersion>
is folder name:open it in an XML editor .. (even notepad is fine)
and add below line :
under below XPath:
configuration/system.web/httpHandlers
replace the existing one!
Add below line:
under below XPath:
Worked like gem for me :)