zoukankan      html  css  js  c++  java
  • IIS7下ajax报未定义错误

    项目之前在iis6环境下运行的很好,今天在WIN7下发布,结果居然报对象未定义错误,经过个把小时折腾,终于弄清楚原委。

    在web.config中关于AjaxPro的设置,在IIS7.0(WIN7中使用的为IIS7.0)下需要在

    <system.webServer><handlers>下增加节点,如下所示:

    <system.webServer>
        <handlers>
          <remove name="WebServiceHandlerFactory-Integrated"/> 
          <remove name="ScriptHandlerFactory"/>
          <remove name="ScriptHandlerFactoryAppServices"/>
          <remove name="ScriptResource"/>
          <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          <remove name="ajaxpro"/>
          <add name="ajaxpro" verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
          <remove name="ajaxpro2"/>
          <add name="ajaxpro2" path="AjaxPro/*.ashx" verb="POST,GET" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2" />
        </handlers>
      </system.webServer>

    其中的remove不是必须,但是经常会有一些重复定义的错误出现,所以还是加上比较保险。

  • 相关阅读:
    pl sql 编程
    maven(一) maven到底是个啥玩意~
    Oracle 数据库管理员
    Oracle 常用函数
    Oracle 事务
    Oracle 分页
    java String类
    java 方法
    java 数组
    java 跨平台 数据类型 修饰符 程序结构
  • 原文地址:https://www.cnblogs.com/waban/p/ajaxproerror.html
Copyright © 2011-2022 走看看