Is there any way to enforce including a script without the need to use either a Extender control or a Script control? In other words: Without the need to create an additional control instance for every script include?
I cannot derive my controls from ScriptControlBase to use the RequiredScript attribute directly on them because I rely on the CompositeControl base class.
A also don't want to create a dummy extender control instance as a child control of every control thats relies on those scripts.
Instead of calling a single liner (RegisterClientScriptResource) for each required script as I do now, I would need to create a extender object for each script, put them in the child control collection and I fear I have to render them too. Thats frankly 5 lines for each script (including assigning TargetControlID), on every single script requiring control, requires me to additionally override some methods on several controls and is not a cool solution. Thats a LOT of unnecessary overhead for just including a javascript code file only when it's needed. :-/
A 'cheaper' method would be ripping the scripts out of the assemblies again, combine them in one big file and include that on every dynamic page, regardless if the scripts are needed or not depending on what controls are currently on that page.
But that's pretty uncool too.
Isn't there a 'cool' solution to include a simple combineable script file?