404 – ScriptResource.axd? Where is it??

HI

I have used fiddler on my non working AJAX site, and it reports a 404 on scriptresource.axd?  eg 404 /AusTest/ScriptResource.axd?d=ZLki_IjVMO0boYXA-y4gC1cwh8RCxVzqKkV2XtNku4YljtUILJl0Z8Mid1UbpVvSvRDwVvVkOJoMZtJ05peUYPBgtEJe6jMT-m4cE_pxfJr_pBFp0nw61Z56Mc36kzsByjhcTwIQJAhgE1eG3UMaag2&t=633100901805313464
not found.

 Well, its not there, and I can’t find it anywhere. How does this work? I have all the entries in the web.config?

  <httpHandlers>
   <add path="CrystalImageHandler.aspx" verb="GET" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
   <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
   <remove verb="*" path="*.asmx"/>
   <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
  </httpHandlers>
  <httpModules>
   <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </httpModules>

and 

 <system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  <modules>
   <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </modules>
  <handlers>
   <remove name="WebServiceHandlerFactory-Integrated"/>
   <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.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=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </handlers>
 </system.webServer>

 

Please please help!

Please see if following links are help full

http://www.worldofasp.net/AJAX/re-1923_Demystifying-%E2%80%98Sys-is-undefined.aspx

http://forums.asp.net/thread/1583736.aspx

HI Swell,

Can you past some of your code here. then we can take a look at it. Thanks!

PS: i suppose that your non working AJAX site must become a working AJAx site [:)]

Regards,

Please see this link also.Refer "Bad IIS Setup" part in the blog.

http://www.rosshawkins.net/rfh/articles/webresource.axd.html 

Hi! Thanks so much for replying.

First, Dennis, I have copied the SampleWebSite directory from the Toolkit to my Web Server, and when I go to any of the pages with controls I still get the 404 from the request. This leads me to believe it is not a web.config related problem.

Second, anishdevasia, I have set enableCompression="false", I think I have a Web application rather than just a virtual directory but i’m not sure (It has an icon that looks like a globe coming
out of a box (IIS 5 btw)) and I have run "aspnet_regiis -i -enable" from C:WINNTMicrosoft.NetFrameworkv2.0.50727. The second link you provided was too complicated for me : (

I also checked and I do have the correct mapping for .axd files and "verify file exists" is indeed deselected.

 

Any other ideas? It must be IIS right because I am using the sample we site…

 

Do you have Visual Web Developer Express Edition or Visual Studio 2005 ? Then you can use the development server provided within that and see if the site is working.

Yep I have loaded the SampleWebSite and our actual site that I want to deploy in Visual Studio 2005 on my development machine and they both run fine through localhost.
While checking with fiddler are you getting same error for WebResource.axd which is there with usual asp.net 2.0 pages.(if you created simple aspx form then at least one call to WebResource.axd will be made).Then we can rule out the assumption regarding .axd
extetnsion.

Nope that one is fine… we must be getting close right?

 

WebResource.axd?d=Qqed81aNx6h85Ex91MKz1A2&t=632876586359375000 Status: 200 Response Size: 2,048

Can you paste the code you are using on the page.Is this 404 error happens for all ScriptResource.axd file.
Its all at http://www.e-timesheetz.com/SampleWebSite/ , does it give you an error as well?

I have tried that url and me too getting same 404.

Have tried to run the same on your Dev Machine IIS(not vs2005 dev web server)? 

Yes I can run through a localhost set up in IIS, they both appear to have the same settings

Have you installed ASP.NET AJAX v1.0 on ther server?If not install the same.

Then check following assemblies are present in GAC

System.Web.Extenstions

System.Web.Extensions.Design 

I could only repair the ASP.NET AJAX v1.0 installation as it was already installed

System.Web.Extenstions and System.Web.Extensions.Design are both listed if i do gacutil /l

 I note that in my web.config I have System.Design commented out as I read that it caussed conflicts, should I remove it from the GAC as well?

 

If Still problem persists you can use javascript files directly.Do the following things

1. Create a folder structure "ScriptLibrarySystem.Web.Extensions1.0.61025.0" in website root directory.

2. Copy following files from installation folder to above created folder

MicrosoftAjax.js

MicrosoftAjaxTimer.js

MicrosoftAjaxWebForms.js 

MicrosoftAjax.debug.js

MicrosoftAjaxTimer.debug.js

MicrosoftAjaxWebForms.debug.js

3. Modify script manager control as given below.

      <asp:ScriptManager ID="ScriptManager1"   runat="server" ScriptPath="ScriptLibrary">
            <Scripts>
                <asp:ScriptReference Assembly="System.Web.Extensions" Name="MicrosoftAjax.js" />

                <asp:ScriptReference Assembly="System.Web.Extensions" Name="MicrosoftAjaxWebForms.js" />
            </Scripts>

        </asp:ScriptManager>   

 4. This is only for basic libraries.Toolkit also could be done similiarly.

I don’t think its a good solution for production scenario. Its only a workaround.

You can check you IISlogs for more error information if any. 

 

May be usefull. Lots of experienced hands on this thread. 

http://forums.asp.net/2/1500402/ShowThread.aspx

Eureka!

I finally hunted down the IIS 5 logs, it has an entry for ScriptResource.axd, it says "Rejected-By-Urlscan"?!?!?

Sure enough, there’s a program called urlscan in the bowels of my winnt directory… open up urlscan.ini, hunt around…

[DenyUrlSequences]

/Script

Hmm so I create a file in my website root called ‘ScriptResource.htm’, sure enough, 404 – Create a file called ‘ScreptResouce.htm’, and it serves!

So i’ve commented out that line, and i’ll have to restart IIS tonight, but fingers are crossed!

 

Thanks Anish!

 

Good work!!!

Congrats!!

Enjoy

There are quite a lot of reasons this error can happen, once I’ve encountered it, I’ve tried them all, and then found out that the most stupid reason is what caused me to loose ScriptResource.aspx: The server’s clock was not rewinded.

Here’s an article that helped figure it out(It also lists some more reasons why this can happen):

ScriptResource.aspx Not Found

Visual Studio had edited the web.config based on the IIS 6.0 model and had made an entry for the Http Handler under the <httpHandler> section. With IIS 7.0 this section is no longer read. So we need to make the proper entries for the Http Handler that handles
the calls to ScriptResource.axd

Solution 1:

  1. Open IIS 7 or 7.5
  2. Select the site to modify by double clicking, revealing all options.
  3. Double click on Handler Mappings
  4. Click Add Managed Handler
  5. Request path: ScriptResource.axd
  6. Type: System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  7. Name: ScriptResource-axd
  8. Click OK to complete

 

Solution 2:

Make entry for handler in webconfig under system.webServer

<system.webServer>

    <handlers>

    <add name="ScriptResource-axd" path="ScriptResource.axd" verb="*" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </handlers>

</system.webServer>

Leave a Reply