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>
<configuration>
2
3 <system.web>
   <system.web>
4
5 <httpHandlers>
      <httpHandlers>
6
7 <add verb="*" path="*.mspx" type="System.Web.UI.PageHandlerFactory" />
         <add verb="*" path="*.mspx" type="System.Web.UI.PageHandlerFactory" />
8
9 </httpHandlers>
      </httpHandlers>
10
11 </system.web>
   </system.web>
12
13 </configuration>
</configuration>
14
 <configuration>
<configuration>2

3
 <system.web>
   <system.web>4

5
 <httpHandlers>
      <httpHandlers>6

7
 <add verb="*" path="*.mspx" type="System.Web.UI.PageHandlerFactory" />
         <add verb="*" path="*.mspx" type="System.Web.UI.PageHandlerFactory" />8

9
 </httpHandlers>
      </httpHandlers>10

11
 </system.web>
   </system.web>12

13
 </configuration>
</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>
<configuration>
2
3 <system.web>
<system.web>
4
5 <httpHandlers>
<httpHandlers>
6
7 <add path="*.mspx" verb="*" type="System.Web.UI.PageHandlerFactory" />
      <add path="*.mspx" verb="*" type="System.Web.UI.PageHandlerFactory" />
8
9 </httpHandlers>
 </httpHandlers>
10
11 <compilation>
<compilation>
12
13 <buildProviders>
   <buildProviders>
14
15 <add extension=".mspx" type="System.Web.Compilation.PageBuildProvider" />
     <add extension=".mspx" type="System.Web.Compilation.PageBuildProvider" />
16
17 </buildProviders>
    </buildProviders>
18
19 </compilation>
</compilation>
20
21 </system.web>
</system.web>
22
23 <configuration>
<configuration>
24
 <configuration>
<configuration>2

3
 <system.web>
<system.web>4

5
 <httpHandlers>
<httpHandlers>6

7
 <add path="*.mspx" verb="*" type="System.Web.UI.PageHandlerFactory" />
      <add path="*.mspx" verb="*" type="System.Web.UI.PageHandlerFactory" />8

9
 </httpHandlers>
 </httpHandlers>10

11
 <compilation>
<compilation>12

13
 <buildProviders>
   <buildProviders>14

15
 <add extension=".mspx" type="System.Web.Compilation.PageBuildProvider" />
     <add extension=".mspx" type="System.Web.Compilation.PageBuildProvider" />16

17
 </buildProviders>
    </buildProviders>18

19
 </compilation>
</compilation>20

21
 </system.web>
</system.web>22

23
 <configuration>
<configuration>24

这个mspx可以修改为我们想要的任何类型.
    (作者:侯垒) 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号