views:

624

answers:

2

I'm currently using the CompositeScript feature of System.Web.Extensions in order to combine my JavaScript files to reduce download time. However, by including any script manager, the MicrosoftAjax JavaScript code is included in my pages. I do not want this to happen as it adds a lot of unneeded code and it complicates event handling.

I'm looking for one of the following:

  1. An alternative to the Microsoft Script Manager that combines JavaScript files, does not include MicrosoftAjax, and still allows user controls to add scripts to the composite script.
  2. A way to persuade Microsoft's Script Manager to not emit any JavaScript that I don't specify.
A: 

Its basically just a static string builder class with a few formatting functions, shouldn't be too hard to write your own script manager class if there is no way to stop it from emitting the ajax framework script.

Element
Building the JavaScript string is easy if I know which files to include. How do I know that, though? The MS version seems to use some magic hash in the ScriptResource.axd to tell it while files to join. I suppose I could just concat a list of filenames in the query string...
Brian Victor
I would just create a Register() method very similar to page.clientscript.registerclientscript() that takes a key value and have a hash list in your class to store them, then at the end of the page cyle join all the strings in the hashlist
Element
Maybe I'm misunderstanding. I see how your technique can generate the URL to the JavaScript combiner, but how does the combiner (which operates in a different request) know which files the page registered?
Brian Victor