RadControls for ASP.NET AJAX
By default, each of the RadControls for ASP.NET AJAX serves a set of files (JS code) needed for its proper client-side operation.
When loading a page with several controls on it, the number of these files can become very large, often resulting in a reduced page load time and increased traffic. The reason for this problem is that browsers make a separate request to the server for each of these resources.
Usually this problem is overcome by disabling the automatic script serving of the controls, combining them into a smaller set of files and registering the links to these files manually on the page.
This approach is not the best for of a number of reasons:
You must extract the files from the assembly for each control release.
Files become too large to be maintainable (or you have to write a script to merge the source files).
The number of merged files you need to maintain can become very large depending on the control sets you have on different pages.
The performance gain of RadScriptManager should be monitored on a remote server, but not in a local development. This is, because the control optimizes the network latency delay when loading the scripts. This comes at the cost of some processor load, because the scripts get combined and compressed on the server.
When testing locally, the largest part of the result you get is the time RadScriptManager takes to combine the scripts and serve them to the browser.
Note that the RadScriptManager does NOT combine the web resources needed for the Telerik controls in a single request when the CDN is enabled.
RadScriptManager needs an HttpHandler to be declared in the application configuration file to operate properly. The addition of the handler is made easier by the SmartTags of the control.
The RadScriptManager control replaces the ScriptManager available in the Microsoft Ajax Extensions suite.
When put on the page, the RadScriptManager combines all requests
RadScriptManager does this by outputting a <script> tag with a specific URL, making a request to an HttpHandler, which then serves the combined scripts.
If the script combination is not needed for some reason (e.g. debugging) it can be disabled by giving the EnableScriptCombine property the value of False.
You can change Handler by using the HttpHandlerUrl property of the control.
Registering the HttpHandler for web sites running on IIS 5.0, 5.1 and 6.0:
<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" />
Registering the HttpHandler for Websites Running on IIS7:
When in integrated mode, IIS7 reads the application configuration from the <system.webServer> section group in the application configuration file, but not the <system.web> section group. Since Visual Studio 2005 does not provide "native" support for IIS7, the RadScriptManager registration cannot be automatically added to the system.webServer.
There are two cases:
Limitations of the Control:
RadScriptManager ignores ScriptReferences to scripts embedded in an assembly, but pointed to a script file by using the Path property:
<telerik:RadScriptManager ID="”RadScriptManager1”" runat="”server”">
<asp:ScriptReference Name="MyNamespace.MyFile.js" Assembly="MyAsembly" Path="/MyVirtualLocation/MyFile.js">
RadScriptManager does not support the automatic switch to debug-mode. For example, having an assembly including ScriptReferences in both Debug and Release ScriptMode, where the application is in a debug mode, RadScriptManager will output only the "Release" ones. If debugging is needed, the EnableScriptCombine property can be set to False.
RadScriptManager currently does not display IntelliSense information for the <Scripts> property and the ScriptReferences.