We have a 3rd party portal that makes a copy of a html/aspx page, and puts it into a temporary folder, CHANGING THE EXTENSION to .HTML in all cases (also it the root page was .aspx).

Unfortunately, that means it does not execute the ASP.NET inline scripts...

So my question:
Is it possible to get IIS 6 & 7 to interprete (and then execute) a HTML page as aspx page ?
(It's not possible to change the 3rd party portal)

Should be possible.

I only found this one:

but it's only talking about asp, and not asp.net.


Yes, it's possible. The link you provided is correct, although like you say it's for asp.dll instead of aspnet_isapi.dll.

The way to do it in IIS6 is:

  • Edit the properties of the website
  • Select the Home Directory tab
  • Click the Configuration button
  • Edit your .aspx entry and copy the path into your clipboard
  • Create a new extension for .html (and .htm if you want) and paste what you have in the clipboard.

You'll also need to tell ASP.NET what to do with .html pages. To do this, in your web.config file, add a new entry to your httpHandlers section, like so:

   <add path="*.html" verb="*" type="System.Web.UI.PageHandlerFactory" />

In IIS7, if you are running your app pool in Classic mode then go to the website and the Handler Mappings section.
Take note of the entries for Path=.aspx.
Copy them and make them as .html.

Then do the same step to your web.config that I mentioned above.

If you're using integrated mode in IIS7, then you only need to do the web.config addition.

  • Finally, a reason to like IIS7. Thank you very much. – Quandary Jun 30 '11 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.