Mapping classic asp pages to .net in IIS

吃可爱长大的小学妹 提交于 2019-12-05 09:02:36

Actually you are only one step far from the success. Adding following section to your Local website(or virtual directory) web.config file:

<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>

It looks like the .asp extension is mapped to the HttpForbiddenHandler.

If you're using ASP.NET 1.1 then open the following file:

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config

If you're using ASP.NET 2.0 then open this file:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config

Search for "path="*.asp"", then comment out that line. It'll like something like:

<!-- machine.config/ASP.NET 1.1-->
<add path="*.asp" verb="*" 
     type="System.Web.HttpForbiddenHandler"/>`

<!-- web.config/ASP.NET 2.0-->
<add path="*.asp" verb="*" 
     type="System.Web.HttpForbiddenHandler" validate="true"/>`

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 :

<add path="*.asp" verb="*" type="System.Web.UI.PageHandlerFactory" validate="True"/>

under below XPath:

configuration/system.web/httpHandlers

replace the existing one!

Add below line:

<add extension=".asp" type="System.Web.Compilation.PageBuildProvider"/>

under below XPath:

/configuration/system.web/compilation/buildProviders

Worked like gem for me :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!