I am using NetAdvantage for ASP.NET 2009v1. I am using both the ASP.NET AJAX and non ASP.NET AJAX controls. The obvious result is that a lot of JavaScript files are needed. This results in less than optimal load times with lower bandwidth connections.I noticed that if I change the system.web->compilation->debug attribute to false in the web.config the core files used by the ASP.NET AJAX controls will be loaded using a "combined" script file. However, the specific ASP.NET AJAX control JavaScript files as well as the non ASP.NET AJAX control JavaScript files continue to use separate files.Is there a "built in" way to get the JavaScript files to use a combined file at run time?
I say "built in" b/c I am looking for a way that is inherent in either the controls themselves or the ScriptManager. Looking through the code (for the IG controls and the ScriptManager) there doesn't appear to be a way to handle scripts _not_ registered via the ScriptManager's "void RegisterScriptControl<TScriptControl>(TScriptControl scriptControl)" method - which is the non ASP.NET AJAX controls. (For scripts registered via RegisterScriptControl, I know I can use the ResolveScriptReference event to combine scripts, I have that working, so that isn't a problem.)
Also, looking through the code, it appears that I might be able to use reflection to get at and manipulate a couple of the key instance variables that the ScriptManager and ClientScriptManager use to handle client script references in order to discover and combine JavaScript files. But this make me nervous in terms of a robust, long term solution.
Thanks-
Up until this point we were not able to provide a good solution for this problem, as Microsoft has a limitation when it comes to combining scripts through their ScriptManager, the URL becomes very long and an exception is thrown by the framework.
In 10.2 we have introduced a new option - CDN. It can serve combined version of the js files, but for ASP.NET AJAX controls only. If you'd like to see non-ajax controls to be handled the same way please contact the product manager and let him know.
We're still looking into providing a good way of combining the scripts throw the script manager.
By the way if you simply drop the ScriptManager on the form, non-ajax controls will be using it to register its scripts.