I need IIS 7 to return a classic ASP request as basic text/html. This is for an internal application that will request the pages through ajax. The ASP code contains errors beyond the scope of this project, and prevents the request. I simply want to return the contents of the ASP page as though it were regular html, so that I can process the information in my application.
One thought was to apply on error resume next to all pages, but that would take too long. I’ve already tried deleting the Handler Mapping, or attempting to purposely limit the mapping by it’s properties, but get an IIS 7 security error message.
If this could also be done against IIS 6 that would be great, but not required.
UPDATE To provide a better example of what I’m attempting to achieve: I managed to move forward on the project by completely uninstalling ASP from Windows Programs and Features in the control panel, then creating a MIME for .asp as “text/html”. This works, but it takes down ASP for the entire server, so I had to re-enable it for other developers working on other projects. Is there no way to do this for one site, rather than the entire server’s roles and responsibilities?
POSSIBLE ANSWER
For this site only, I updated the ASP Handler Mapping so that the asp DLL responds to “.aspdont”. Then I added my own MIME type for .asp as “text/html”. Seems a little sloppy, but given what I have to work with, that might be my only solution.
You cannot disable Classic ASP for one site; you can only deny it, or uninstall it, at the server level. There are two possible workarounds: Move it to a new server without Classic ASP installed, or, at the site level, remap the handler for .asp to an unused extension, like .aspdont. Then, for either solution, create the MIME type at the site level for .asp as text/html. Now the pages will return ASP unprocessed.