zoukankan      html  css  js  c++  java
  • IIS7中配置集成模式,使其可使用httpModules、httpHandlers【转】

    http://www.cnblogs.com/catcherx/p/3330909.html

    第一种方法:配置应用程序池

      在IIS7上配置应用程序池,并且将程序池的模式改为“经典”,之后一切正常。如图:

    第二种方法:修改web.config配置文件:

    例如原先设置(你的环境中可能没有httpModules,httpHandlers节点)

    1. <system.web>  
    2.   
    3.     ............  
    4.   
    5.     <httpModules>  
    6.         <add name="MyModule" type="MyApp.MyModule" />  
    7.     </httpModules>  
    8.     <httpHandlers>  
    9.       <add path="*.myh" verb="GET" type="MyApp.MyHandler" />  
    10.     </httpHandlers>  
    11.    .............  
    12.   
    13. </system.web>  
    <system.web>
    
        ............
    
        <httpModules>
            <add name="MyModule" type="MyApp.MyModule" />
        </httpModules>
        <httpHandlers>
          <add path="*.myh" verb="GET" type="MyApp.MyHandler" />
        </httpHandlers>
       .............
    
    </system.web>
    

     在IIS7应用程序池为“集成模式”时,改为:(httpModules改为modules,httpHandlers改为Handlers了)

    1. <system.web>  
    2.   
    3.     ...........  
    4.   
    5. </system.web>  
    6.   
    7. <system.webServer>  
    8.   
    9.     <modules>  
    10.       <add name="MyModule" type="MyApp.MyModule" />        
    11.     </modules>  
    12.     <handlers>  
    13.       <add name="MyHandler" path="*.myh" verb="GET" type="MyApp.MyHandler" preCondition="integratedMode" />  
    14.     </handlers>  
    15.   
    16. </system.webServer>  
    <system.web>
    
        ...........
    
    </system.web>
    
    <system.webServer>
    
        <modules>
          <add name="MyModule" type="MyApp.MyModule" />      
        </modules>
        <handlers>
          <add name="MyHandler" path="*.myh" verb="GET" type="MyApp.MyHandler" preCondition="integratedMode" />
        </handlers>
    
    </system.webServer>
    

     (如果你的web.config没有httpModules,httpHandlers节点,则直接在节点system.webServer中添加:

       <validation validateIntegratedModeConfiguration="false" />  
    这样可以禁止验证集成模式,避免错误提示。


  • 相关阅读:
    Vue之仿百度搜索框
    Vue之交互
    Vue之键盘事件
    Vue之事件冒泡
    Vue之阻止默认行为
    sql注入常用注释符总结
    什么是Git
    Github部署博客
    php笔记
    JavaScript(更新中)
  • 原文地址:https://www.cnblogs.com/zhanghai/p/4922968.html
Copyright © 2011-2022 走看看