12.12.05

mapping .html to .aspx update (ASP.NET 2.o)

Posted in Programming at by chenty

I am currently testing ASP.NET 2.0, and migrating some of my projects to ASP.NET 2.0. I wrote an article about mapping .html to .aspx on Sep 6th, 2005, and I found that method is not working on ASP.NET anymore. So I guess I should write an update for it.

You can find my original post at: http://www.bizpassion.com/?p=22

The concept is basically the same. However, you need to modify web.config a bit.

You need to add “buildProviders” in “compilation” tag.

  1. <compilation debug="false">
  2.   <buildproviders>
  3.     <add extension=".html" type="System.Web.Compilation.PageBuildProvider" />
  4.   </buildproviders>
  5. </compilation>

Note: when I post, my blog software auto change some capital letters to lower case, which are case-sensitive in web.config. Make sure you use “httpHandlers” and “buildProviders” instead of “httphandlers” and “buildproviders”.

After you adding these, it should be work the same way as ASP.NET 1.1.