本文介绍了你如何更改扩展名是净页将下运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的.NET应用程序使用.html扩展名,而不是的.aspx

I need my .net application to use the .html extension instead of .aspx

我将一个PHP应用程序,并有依赖于该扩展外部应用程序的功能。

I'm converting a php app and there are external applications which depend on that extension to function.

什么是做到这一点的最好方法是什么?

What is the best way to do this?

感谢

推荐答案

在IIS,当您创建的应用程序虚拟目录,点击配置应用程序,并编辑应用程序映射,即增加一个新的映射为HTML。

In IIS, when you create the application for the virtual directory, click on "Configuration" for the application, and edit "App mappings", i.e. add a new mapping for html.

或者,在你的web.config中添加本节:

Or, in your web.config, in add this sections:

<httpHandlers>
   <remove verb="*" path="*.html" />
   <add verb="*" path="*.html" type="System.Web.UI.PageHandlerFactory" />
</httpHandlers>
<compilation>
   <buildProviders>
       <buildProvider 
           extension=".html" 
           type="System.Web.Compilation.PageBuildProvider" />
   </buildProviders>
</compilation>

编辑:增加了一节,根据注释。由于克里斯。

Added the section, according to the comment. Thanks Chris.

这篇关于你如何更改扩展名是净页将下运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 15:28