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不是必须,但是经常会有一些重复定义的错误出现,所以还是加上比较保险。

  • 相关阅读:
    右值和move 与 forward
    C++11的chrono库,实现毫秒微秒级定时
    HDOJ 1176 免费馅饼(完全背包)
    HDU 1069 Monkey and Banana
    杭电 1003 Max Sum (动态规划)
    UVA ~ 514 ~ Rails (栈)
    UVA 679
    UVA11988 Broken Keyboard (a.k.a. Beiju Text)【数组模拟链表】
    Codeforces 845 C Two TVs
    codeforces 845A Chess Tourney
  • 原文地址:https://www.cnblogs.com/waban/p/ajaxproerror.html
Copyright © 2011-2022 走看看