Hi,
sorry for bothering you, but this is getting me crazy.
I'm using 2010q2.
The problem:
What I'm trying to accomplish is to use external js files instead of the "axd" resource files.
I've looked to your examples and I don't find them suitable for an application of medium/large dimension.
In fact you are suggesting of adding the scripts to the ScriptManager
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Scripts>
<asp:ScriptReference Path="~/Scripts/Common/Core.js" />
</Scripts>
</asp:ScriptManager>
This is a mess when dealing with hundreds of pages because developers must always remember which js files must be included for each control.
My idea (as a sidenote I've always used this approach with all the third party libraries I've used in all my projects):
I inherited from your controls, for example I created
public class ExTabStrip : RadTabStrip
(another sidenote: I plan to do it independently of this issue, because it is always better to be able to add new behaviors to third party controls)
Since I know a bit of asp.net I've looked to your controls and noticed that they are implementing MS IScriptControl interface, so I thought the right solution was to override
IEnumerable<ScriptReference> GetScriptReferences()
and add there the external js files. In this way everything is wrapped in the control and the page must not know about these details.
For example
But I get a lot of js errors. Sometimes this happens because some js files are imported more than once in the page (like the "PopupScripts.js" script)
Is this approach correct?
Is there any way to reach my goal?
Best regards, Andrea Pirola
sorry for bothering you, but this is getting me crazy.
I'm using 2010q2.
The problem:
What I'm trying to accomplish is to use external js files instead of the "axd" resource files.
I've looked to your examples and I don't find them suitable for an application of medium/large dimension.
In fact you are suggesting of adding the scripts to the ScriptManager
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Scripts>
<asp:ScriptReference Path="~/Scripts/Common/Core.js" />
</Scripts>
</asp:ScriptManager>
This is a mess when dealing with hundreds of pages because developers must always remember which js files must be included for each control.
My idea (as a sidenote I've always used this approach with all the third party libraries I've used in all my projects):
I inherited from your controls, for example I created
public class ExTabStrip : RadTabStrip
(another sidenote: I plan to do it independently of this issue, because it is always better to be able to add new behaviors to third party controls)
Since I know a bit of asp.net I've looked to your controls and noticed that they are implementing MS IScriptControl interface, so I thought the right solution was to override
IEnumerable<ScriptReference> GetScriptReferences()
and add there the external js files. In this way everything is wrapped in the control and the page must not know about these details.
For example
But I get a lot of js errors. Sometimes this happens because some js files are imported more than once in the page (like the "PopupScripts.js" script)
Is this approach correct?
Is there any way to reach my goal?
Best regards, Andrea Pirola