I have this WebApp in .NET 3.5, using MS Ajax and jQuery UI. It works fine locally but when I publish it on the statging server it gives a 'Sys' undefined javaScript error. Furhter investigation, I found that the .axd files are not loaded and it is a 404. I checked the web.confing and I have the necessary entries under the . I googled and read every post and could not find a solution for it. Is there anyone who has run in to a prblme like this before?
问题:
回答1:
I just ran into it with our server on IIS 6. It was handled by making sure to have in the system.web section (different for IIS7).
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler" validate="false"/>
</httpHandlers>
回答2:
I had correct settings in web.config, I fixed the issue by changing the IIS 8 to run in 'Classic' mode rather than 'Integrated' mode.
回答3:
This worked for me:
Add the below handler to your web.config:
<system.webServer>
<handlers>
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="integratedMode" />
回答4:
In my case I was using Routing in Web Forms Application. Following steps resolved the issue for me. Its weird but it worked. It might help someone who has implemented routing in web forms. My project was .Net 4.5
- I commented
RouteConfig.RegisterRoutes(RouteTable.Routes);
- Built the Project
- Uncommented :
RouteConfig.RegisterRoutes(RouteTable.Routes);
- Built the Project
- Loaded page again and Web page animation for Update Panel was working fine
回答5:
I also saw this behavior on a hosted web service; the local version had no problem. After trying dozens of variation of system.web/httpHandlers and system.webServer/handlers statements, I finally gave up and tried the most inelegant solution of creating a dummy ScriptResource.axd - voila, it worked! I'm guessing there was some hidden validation setting in IIS at the hosting level despite setting 'validate=false' in web.config.