How do I process .asp extensions using the .Net handler?

后端 未结 4 1500
日久生厌
日久生厌 2021-01-26 09:56

I have an older classic ASP website that I am migrating over to IIS7.5. I don\'t feel like installing classic ASP on the server, and so I just want the .asp files to be treated

相关标签:
4条回答
  • 2021-01-26 10:23

    It won't work. ASP and ASP.NET are different things.

    ASP.NET doesn't support VBScript, for instance. It also doesn't support includes.

    0 讨论(0)
  • 2021-01-26 10:26

    I Think ASP is not enabled by defualt in the IIS7, so you might have to enable it by using windows control panel Control:

    Panel/Programs/Turn On/Off Windows Features/Internet Information Services/WorldWideWeb Services/ Application Development Features / [ASP][ISAPI FILTERS] etc...

    Then choose all features you need.

    Cheers

    0 讨论(0)
  • 2021-01-26 10:33

    That's not going to work. Aspnet_isapi.DLL, which handles executing ASP.NET applications, doesn't understand classic ASP, and will try to parse the classic VBScript code as .NET VBScript.

    The only way this is feasible is if you have no (and I mean ABSOLUTELY NONE) classic ASP code in your .ASP pages.

    If that is the case, you can map the .ASP extension to aspnet_isapi in IIS manager.

    1. Open inetmgr.
    2. Select the website
    3. In the Feature View panel, select "Handler Mappings" alt text
    4. Add a mapping for .ASP to C:\Windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll (assuming you're using ASP.NET 2.x).

    Again, if you have any code in your .asp pages, this will cause a glorious, technicolor failure for every .ASP page.

    Another option is to use a rewrite engine (we use ISAPI Rewrite) to change the file extension of incoming requests from from .asp to .aspx.

    Why don't you want to install classic ASP on the server? It works just fine in parallel with ASP.NET.

    edit

    It's actually called "handler mappings." See image above.

    0 讨论(0)
  • 2021-01-26 10:34

    You must follow the start menu as given below to get VS2010 command prompt.

    1. Start -> All Programs -> Microsoft Visual Studio 2010 -> Visual Studio Tools -> Visual Sutdio Command Prompt(2010)

    2. Right Click on the Visual Studio Command Prompt (2010) and select Run as Administrator in case of Windows 7 and Vista

    3. then apply aspnet_regiis.exe -i

    0 讨论(0)
提交回复
热议问题