win7操作系统IIS7下ajax报未定义错误

来源:互联网 发布:超级舰队老僧扫矿软件 编辑:程序博客网 时间:2024/04/30 01:16
之前,Window XP、Windows2003下,使用Ajax都是正常的,自从更换Win7操作系统之后,Ajax就一直报未定义错误,以下为解决方法,仅供参考。
在web.config中关于AjaxPro的设置,在IIS7.0(WIN7中使用的为IIS7.0)下需要在<p><system.webServer><handlers>下增加节点,如下所示:</p>
<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>

 

0 0