asp.net修改网页扩展名
asp.net默认扩展名为.aspx,可是我们看到许多网站的扩展名很特别比如微软的.mspx,下面讲解如何将网页扩展名改为mspx.
ASP.NET 1.1中的方法:
1.IIS映射(IIS->默认网站->属性->主文档->配置->映射->添加):
扩展名.mspx ----> C:"WINNT"Microsoft.NET"Framework"v1.1.4322"aspnet_isapi.dll
限于:GET,HEAD,POST,DEBUG
2.修改web.config
1<configuration>
2
3 <system.web>
4
5 <httpHandlers>
6
7 <add verb="*" path="*.mspx" type="System.Web.UI.PageHandlerFactory" />
8
9 </httpHandlers>
10
11 </system.web>
12
13</configuration>
14
2
3 <system.web>
4
5 <httpHandlers>
6
7 <add verb="*" path="*.mspx" type="System.Web.UI.PageHandlerFactory" />
8
9 </httpHandlers>
10
11 </system.web>
12
13</configuration>
14
ASP.NET 2.0中的方法:
1.IIS映射(IIS->默认网站->属性->主文档->配置->映射->添加):
扩展名.mspx ----> C:"WINDOWS"Microsoft.NET"Framework"v2.0.50727"aspnet_isapi.dll
限于:GET,HEAD,POST,DEBUG
2.修改web.config
1<configuration>
2
3<system.web>
4
5<httpHandlers>
6
7 <add path="*.mspx" verb="*" type="System.Web.UI.PageHandlerFactory" />
8
9 </httpHandlers>
10
11<compilation>
12
13 <buildProviders>
14
15 <add extension=".mspx" type="System.Web.Compilation.PageBuildProvider" />
16
17 </buildProviders>
18
19</compilation>
20
21</system.web>
22
23<configuration>
24
2
3<system.web>
4
5<httpHandlers>
6
7 <add path="*.mspx" verb="*" type="System.Web.UI.PageHandlerFactory" />
8
9 </httpHandlers>
10
11<compilation>
12
13 <buildProviders>
14
15 <add extension=".mspx" type="System.Web.Compilation.PageBuildProvider" />
16
17 </buildProviders>
18
19</compilation>
20
21</system.web>
22
23<configuration>
24
这个mspx可以修改为我们想要的任何类型.
(作者:侯垒)