This article explains the most common issues related to WebResource utilization and the Telerik® UI for ASP.NET AJAX controls and their troubleshooting steps.
"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.
There are several ways to see what the WebResource error is:
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).
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.
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:
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).
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).
<location>elements to your web.config for all the handlers you use, so ASP.NET does not block them. For example:
<configuration> ... <location path="Telerik.Web.UI.WebResource.axd"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> <location path="Telerik.Web.UI.DialogHandler.aspx"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> <location path="ScriptResource.axd"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> <location path="WebResource.axd"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> ... </configuration>
Please check the following:
Check in the IIS management console that the .axd extension (the default HTTP handler extension) is allowed under the Handler Mappings feature of IIS:
Also check if the "Verify if file exists" checkbox is unchecked (click on the "Edit" button appearing in the previous screenshot to check).
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:
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
.NET 3.5 and IIS7 Integrated Mode
The following statement should be present in the
<handlers>section instead of
<handlers> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
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.
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:
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
IIS7 Integrated Mode
The following statement should be present in the
<handlers>section instead of
<handlers> <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
Check if there is a firewall, proxy or other similar networking configuration that does not allow access to the axd handler.
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.
Check the detailed error message where the common cases are:
"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.
"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>+,,
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.
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.
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.
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.
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.