6

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?

Shuaib
  • 1,561
  • 3
  • 19
  • 28

6 Answers6

11

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>
Jared
  • 7,165
  • 6
  • 49
  • 52
  • 2
    Well it turned out that there was a URLRewriter installed for PHP and that was intercepting the calls. So we removed it and then things worked fine. – Shuaib Oct 13 '10 at 02:39
3

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.

Mike
  • 1,276
  • 4
  • 16
  • 27
  • 1
    2020 and your solution works for me. Indeed I have the same code coexisting as a independent web site and also as application within on another web. – fcm Jan 14 '20 at 21:13
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.

Shaun
  • 21
  • 1
2

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

  1. I commented RouteConfig.RegisterRoutes(RouteTable.Routes);
  2. Built the Project
  3. Uncommented : RouteConfig.RegisterRoutes(RouteTable.Routes);
  4. Built the Project
  5. Loaded page again and Web page animation for Update Panel was working fine
Mohsin Ali
  • 112
  • 1
  • 7
  • I had same issue. Could not figure it out so I left ajaxcontroltoolkit alone for a long time. I came back to use a combobox and saw all those 404 errors. I removed the routing rewrite code in my web.config which was implemented to remove the .aspx from the url bar and it worked. – Athanasios Karagiannis Sep 15 '17 at 17:31
  • Tanks, this solution helped me. but there is a explanation. If you uncommented Register route and your code works fin this is beacuse of SourceResource loaded from cache. if you uncommented routeconfig the probblem is came back. I used this solution by adding my mvc codes into an area – Mahdi Ahmadi Jul 18 '20 at 11:14
1

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" />
mparkuk
  • 509
  • 7
  • 14
0

I ran to this same issue after migrating to SmarterASP.Net.

Fixed it by creating empty file ScriptResource.axd