How to include many Javascript files using ToolkitScriptManager linker?

If you have too many javascript files with composite text in the script manager, you get this error ...

"The resource URL cannot be longer than 1024. If you use CompositeScriptReference, reduce the number of ScriptReferences contained in it or merge them into one static file and set the Path property to its location."

I know how to fix this using the old old asp: scriptmanager (use script proxies). But how can I fix this with ToolkitScriptManager?

<ajaxToolkit:ToolkitScriptManager ID="GeneralScriptManager" CombineScripts="true" CombineScriptsHandlerUrl="Utility/CombineScriptsHandler.ashx" runat="server" AsyncPostBackTimeout="480" EnablePageMethods="true">
    <CompositeScript>
        <Scripts>
            <asp:ScriptReference Path="JavaScript/jQuery/jquery-1.4.1.min.js" />
            ... A whole lot more script references here
        </Scripts>
    </CompositeScript>
</ajaxToolkit:ToolkitScriptManager>

Update I tried to do this using the script combiner included in the sample application. I think this is correct, but I was wrong many times before ... No luck, though.

, , , , CompositeScript ToolkitScriptManager, . . . - ? "toolkitscriptmanager Google 1024 ", StackOverflow 1...

+3
2

MSDN :

script , a CompositeScriptReference URL. URL 1024 .

, . - ScriptReference, script . , . .

, - . [1]:

script , , . "" , . , , .

, , - -, *.js , - [2].

.

[1] - http://weblogs.asp.net/bleroy/archive/2008/06/12/script-reference-profiler.aspx

[2] - http://encosia.com/2009/05/20/automatically-minify-and-combine-javascript-in-visual-studio/

+2

Chirpy ToolkitScriptManager. , js css . YUI-Compressor Google Cloture .

lesscss, .

+1

Source: https://habr.com/ru/post/1757429/


All Articles