Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Question:

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:
http://forums.digitalpoint.com/showthread.php?t=270061

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

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

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:

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

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.

share|improve this answer
    
Finally, a reason to like IIS7. Thank you very much. –  Quandary Jun 30 '11 at 20:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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