Arpita
Arpita

Reputation: 455

get scriptresource axd 404 not found

I have an asp.net web application in .NET 4.0, which is using telerik and kendo UI gauges and charts. It works fine locally but on the server side, it gives the following error.

enter image description here

I added enablecdn property in my scriptmanager too.

<asp:ScriptManager ID="ScriptManager1" EnableCdn="true" runat="server">
</asp:ScriptManager>

I also added the following lines in my web.config,

<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

Temporarily, I remove the Telerik.Web.UI.dll and Telerik.Web.UI.Skins.dll files from my application and the page gives the output but after some time it gives the same error.

I did not find any solution from other posts.

Any ideas will be really helpful.

Upvotes: 0

Views: 3191

Answers (3)

Dinao
Dinao

Reputation: 1

I had the same problem with url rewriting

Take care if you are using url rewriting. You can move the root of your application and you can have error 404.

My solution (in .htacess) RewriteRule ^/ScriptResource.axd(.*)$ /ScriptResource.axd$1 [NC,L]

Upvotes: 0

rdmptn
rdmptn

Reputation: 5603

Create a new .NET 4.0 WebApplication so it has all the needed stuff in the web.config and the needed references added already. If the scriptresource handler that is built-in the framework does not function properly for you, there is something wrong with the server.

Then, compare the apps, or just migrate everything to the newly created one. Once the original handlers work, start including additional stuff like Telerik controls.

BTW, here is the basic configuration to get them working

        <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
        <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
        <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
        <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
        <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
    </httpHandlers>
    <httpModules>
    <!-- Only needed if RadUpload is used in the site -->
    <!--    <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" /> -->
    <!-- Only needed if RadCompression is used in the site -->
    <!--    <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />  -->

    </httpModules>
</system.web>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
    <!-- Only needed if RadUpload is used in the site -->
    <!--    <remove name="RadUploadModule" /> -->
    <!--    <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" /> -->
    <!-- Only needed if RadCompression is used in the site -->
    <!--    <remove name="RadCompression" /> -->
    <!--    <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" /> -->

    </modules>
    <handlers>

        <remove name="ChartImage_axd" />
        <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
        <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
        <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
        <remove name="Telerik_Web_UI_DialogHandler_aspx" />
        <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />
        <remove name="Telerik_RadUploadProgressHandler_ashx" />
        <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
        <remove name="Telerik_Web_UI_WebResource_axd" />
        <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
    </handlers>
</system.webServer>

Also, if you are using any kind of authentication, make sure to add elements to allow access to those handlers, for example:

<location path="Telerik.Web.UI.WebResource.axd">
   <system.web>
     <authorization>
       <allow users="*"/>
     </authorization>
   </system.web>
 </location>

Upvotes: 0

Midhun Mundayadan
Midhun Mundayadan

Reputation: 3182

try with this

  <remove verb="*" path="*.asmx"/>
  <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  <add verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler" validate="false"/>

else change the below line

<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

change to

<add verb="GET" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

404 error (Not found) ScriptResource.axd or WebResource.axd

Upvotes: 0

Related Questions