Why do some people turn their asp.net pages into HTML pages when published?

asp.net, c#, html, security

Solution

A) You do it by changing Web.config:

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

B) The reason would be to prevent viewers from knowing what runtime is behind the site, but in most cases with ASP.NET, it's easy to recognize from its additions to the HTML (such as view state etc.)

C) It's up to you really, I wouldn't say it's good or bad.

In response to your comment below:

It's possible that you need to specify a `buildHandler` as well:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true">
      <buildProviders>
        <add extension=".html" type="System.Web.Compilation.PageBuildProvider" />
      </buildProviders>
    </compilation>
    <httpHandlers>
      <add verb="*" path="*.html" type="System.Web.UI.PageHandlerFactory" />
    </httpHandlers>
  </system.web>
</configuration>

Problem

I was just told that I might have to work on a project where i will be working with ASP.NET 3.5 and C#. Someone in our team said that we should change all the pages to HTML when we publish the site. So instead of having www.test.com/Page.aspx we will have www.test.com/Page.html So what i would like to know is: A.) How can this be done and with what tool? B.) Why should this be done and what can we benefit from it? (Was told to prevent hackers to get it) C.) Is this recommended? Thanks in advance.

Original source