Axd File

This article explains the most common issues related to WebResource utilization and the Telerik® UI for ASP.NET AJAX controls and their troubleshooting steps.

A file handler that provides a standard way to inject embedded content requests in to the client-side web request. These files are typically named 'WebResource.axd' and can be enabled when building the web application or web page by changing the web resource value in AssemblyInfo.cs or AssemblyInfo.vb (depending on the language you are using to develop). Windows Server 2003 Microsoft-IIS/6.0 asp.net 2.0 PLESK 9.5.4 Hi I have a website on an hosting service. From fiew days i have a great problem. My log files report thousands of 404 errors for the webresource.axd file, but pages are correctly loaded. My hosting service says. The AXD files are trace handler files that provide instructions to the associated application for the retrieval of embedded resources such as JavaScript files, CSS files and images. They are commonly used to manage website administration requests. These handlers can be built into an application or custom created for a user.

If you are using an ASP.NET server control with rich client-side behavior it is likely built to utilize web resources. Sometimes your page loads and that rich server side control does not work at all — the tree view does not expand, the grid cannot sort etc. Most of the times this is because the JavaScript files of those controls have failed to load.

If your browser is configured to prompt on JavaScript errors you may see an error message similar to this one:

'RadTreeView is undefined'

If you are using Telerik® UI for ASP.NET AJAX, receiving this message indicates that there might be a Web Resource related issue.

The following sections describe ways to find out what is causing that error message.

Determine the Error

There are several ways to see what the WebResource error is:

Manually Requesting the WebResource Handler

The fastest way would be to view the rendered output of your page and get the URL of the offending script tag. For instance:

If you paste that URL in your browser's address bar (after the domain and folder of course), the web server should serve back the content of that web resource. In case of a problem with the web resource HTTP handler you would see an error page saying that the server returned HTTP error code 404 (not found) or 500 (server error).

Using Web Development Tools to Request the WebResource Handler

Axd

Presently, it is very popular to use an HTTP traffic sniffer tool like Google DevTools, Fiddler or Firefox FireBug to find out if the request to a web resource file has failed and what the exact error is.

Dealing with the Error

Once the error is determined, you would have to fix it. The most common errors are 'This is an invalid webresource request' 404 and 500:

This is an Invalid WebResource Request

Such issues often come up when a user has a copy of the page that contains WebResource URLs that have been invalidated by the server (the machine key changed or the Application Pool was recycled). When such a cached copy of the page with the old links is executed, the browser will invoke GET requests for those WebResource URLs and .NET will not be able to decode them anymore, so such exceptions will occur. WebResource URLs are handled by the .NET code and individual controls (like the Telerik controls) cannot affect or fix this.

There are, however, a few ways to alleviate such a problem:

  • After a while browser caches are cleaned up and the users will get correct links, so simply waiting a bit may alleviate the situation

  • Clearing the cache of the browser always helps (press Ctrl+Shift+Del to open the Clear Browsing Data browser dialog or test in Incognito mode)

  • Look into ways to increase the Application Pool recycle time or implement a heartbeat-like functionality to keep it alive at all times

  • You may experience the error in a load balanced environment where the servers are configured to use different machine keys. In this case, the request to a resource may fail due to the encrypted querystring parameter identifying the resource being non-decryptable on the other server. To solve it, you should ensure that all servers use the same and Telerik.Web.UI.WebResourceSession as explained in the Integrating RadControls in WebFarm/WebGarden article.

  • [Important tip] Use the CDNs (for scripts and skins) plus the MS AJAX CDN so WebResources are used as rarely as possible (only some dialogs, the binary image and file uploads will keep using WebResources).

Unauthorized Access (401) Error

When your project uses a form of authentication (e.g., Windows Authentication), access to most resources (like pages, images, handlers) is not allowed for anonymous (unauthorized users). This affects the Telerik controls because they use a number of HTTP Handlers that also get blocked.

There are two ways to resolve this:

  • use the CDNs Telerik provides (for scripts and skins) and the MS AJAX CDN so WebResources are used as rarely as possible (only some dialogs, the binary image and file uploads will keep using webresources).

    You can also use single request for all scripts and a combined base stylesheet request to greatly reduce the number of network requests.

  • Or, add <location> elements to your web.config for all the handlers you use, so ASP.NET does not block them. For example:

    web.config

Axd File Extension

Dealing with the 404 Error Code (the Requested URL was Not Found)

Please check the following:

  1. Check in the IIS management console that the .axd extension (the default HTTP handler extension) is allowed under the Handler Mappings feature of IIS:

  2. Also check if the 'Verify if file exists' checkbox is unchecked (click on the 'Edit' button appearing in the previous screenshot to check).

  3. If you are using Telerik® UI for ASP.NET AJAX check if the 'ScriptResource.axd' HTTP handler is correctly registered in your web.config. Look for the following statement:

    ASP.NET 3.5:

    web.config

    .NET 3.5 and IIS7 Integrated Mode

    The following statement should be present in the <handlers> section instead of <httpHandlers>:

    web.config

    ASP.NET 4.0-4.8: The ScriptResource.axd instance is no longer needed in the web.config as of .NET 4.0 and later, but if you have it in your web.config make sure that its Version value corresponds to the .NET version used by your Web Forms app.

  4. If you are using Telerik® UI for ASP.NET AJAX and RadScriptManager check if the Telerik.Web.UI.WebResource.axd HTTP handler is correctly registered in your web.config:

    ASP.NET 3.5-4.8:

    web.config

    IIS7 Integrated Mode

    The following statement should be present in the <handlers> section instead of <httpHandlers>:

    web.config

  5. Check if there is a firewall, proxy or other similar networking configuration that does not allow access to the axd handler.

Open Axd File

Some popular threads on the error 404 are 404 Not found error, RadSpell - Web.config 404 error, RadAsyncUpload 404 loading Telerik.Web.UI.WebResource.axd, RadEditor - 404 File or directory not found.

Dealing with the 500 Error Code (Server Error)

Check the detailed error message where the common cases are:

Axd File
  1. 'Padding is invalid and cannot be removed'

    The problem is likely to be related with the machine key. This MSDN article describes how to create a custom machine key.

  2. 'Specified argument was out of the range of valid values. Parameter name: utcDate'

    The assembly containing the embedded resources is probably built in the future (its last modified time is later than the current time). This can occur when deploying in a different time zone. In such case run the following command line statement (the commas and plus at the end are important!): copy /b <path to assembly which is built in the future>+,

  3. RadAsyncUpload throws HTTP 500 with a red dot beside the uploaded file name - Make sure that the Telerik.Web.UI.WebResource.axd handler is registered in the web.config.

  4. Telerik.Web.UI.WebResource.axd 500 (Internal Server Error) - the error might be due to a missing/incorrect stylesheet webresource file - in this case, upgrade to the latest available version of the product. You can also the value of the RenderMode property to Lightweight/Classic to see whether it will help. Please also report such an errors in the feedback portal, the ticketing system or the forum so that we can verify and fix them.

  5. Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500 - Usually such an error is thrown when multiple (or nested) AJAX requests are initiated in one and the same time or there is a server error thrown during an AJAX update. You can disable temporary the AJAX on the page in order to see what the actual error thrown on the page is and debug further the cause of it. You can see how to do this easily here: Get more descriptive errors by disabling AJAX.Also make sure that the handlers are registered properly inside the and section of the web.config file as explained at Mandatory Additions to the web.config. You can find other possible reason for the error on ASP.NET, The status code returned from the server was: 500 and Error: Sys.WebForms.PageRequestManagerServerErrorException. Another way to look for the cause of the problem is to remove the AJAX settings one by one unless you find the one leading to the error and, respectively, the controls which updatе is causing it.

What to do if there is no error, but the body of the returned resource is blank

If the Telerik.Web.UI.ScriptFolder or Telerik.Web.UI.ScriptsFolder' web.config appSettings are set, make sure that the path to the resources is valid since it is case-sensitive.You can find more on these properties in the Combining External Scripts article.

Other ASP.NET handler errors related to URL routing, redirects and frendly URLs

Please check the following KB article on the matter: Error: Web.config registration missing! The Telerik dialogs require a HttpHandler registration in the web.config file. Issues 2, 3 and 4 are very common for the axd handlers in ASP.NET Web Forms.

Axd File Type

Axd File

Axd File Format

See Also