简体   繁体   中英

ASP.NET Ajax not running with IIS 7

I have a small web application with ASP.NET AJAX running well under the Cassini ASP.NET from http://www.ultidev.com/ . But when I tried to host it under IIS7, the AJAX is not working. The UpdatePanel, the Calendar extension, the client side validation from the Validation Control are not working at all. I think it must be a problem of IIS 7.

Here's a section of the web.config file:

    <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
        <remove name="ScriptModule"/>
        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </modules>
    <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" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/></handlers>
</system.webServer>

Can anyone tell me what the problme is with IIS 7? How should I configure it to work with ASP.NET AJAX? Thank you.

在web.config文件的“处理程序”部分中添加以下行:

<add name="Ajax" verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>

Delete the next code line if you added AJAX from NUGET and after you add ajaxcontroltoolkit.dll from here: http://ajaxcontroltoolkit.codeplex.com/releases/view/109918

<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>

PD: AJAX CONTROL TOOL KIT 4.5 NOT WORKS WITH FRAMEWORK 4.5. AND AJAX FROM NUGET HAS PROBLEM

I just removed Web Server role and added Web Server role again. It's working now. I think maybe some component that IIS 7 was set up in the first place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM