Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 974229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:24:09+00:00 2026-05-16T03:24:09+00:00

If you have too many javascript file includes with a compositescript in a script

  • 0

If you have too many javascript file includes with a compositescript in a script manager you get this error…

“The resource URL cannot be longer than 1024 characters. If using a CompositeScriptReference, reduce the number of ScriptReferences it contains, or combine them into a single static file and set the Path property to the location of it.”

I know how to fix this using a plane old asp:scriptmanager (use script manager proxies). But how do I fix it using a 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’ve tried doing this with the script combiner included in the sample application. I think it’s right, but I’ve been wrong plenty of times before… No luck though.

Another update So, I thought that maybe if I included multiple CompositeScript blocks within the single ToolkitScriptManager it might create them all as separate files. Nope. Still get the same error. No one has any ideas? When I Google “toolkitscriptmanager cannot be longer than 1024 characters” this StackOverflow question is the number 1 result…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:24:10+00:00Added an answer on May 16, 2026 at 3:24 am

    The MSDN documentation on this is actually pretty good:

    The number of script references that a
    CompositeScriptReference instance can
    contain is limited by the size of the
    resulting URL. The URL cannot be
    longer than 1024 characters.

    If you have to work around this
    limitation, you have two options. The
    first option is to reduce the number
    of ScriptReference objects that the
    composite script contains. The second
    option is to manually combine the
    scripts into a single static file. In
    that case, you can set the Path
    property to the location of the static
    file.

    If you’re looking to combine multiple physical files, you’re going about it the wrong way – see the link below [1]:

    You can combine multiple physical
    script files using that feature, but
    we really don’t recommend it as there
    is some server overhead related to
    file monitoring. What you’re
    describing is much better handled by
    “building” your scripts at compile
    time instead of doing the combination
    at runtime. The feature really is for
    application developers who want to
    combine existing scripts from various
    components that they use in their
    application.

    What I would look for is a post-build task that combines your static *.js files, something like [2].

    Good luck.

    [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/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope this question isn't too dumb. We have many websites internally that need
Is it bad to have too many self-invoking functions in JavaScript? If they all
EDIT: Too many edits :doh: I have identified the problem this time. There is
OK perhaps I have read too many posts on this subject and now I
I have too many images to be download from net into iPhone? How can
I am new to Git and I seem to have one branch too many
I have a menubar(div) which houses bookmarks and when too many bookmarks are inserted
I have the problem that my view controller class has too many delegates and
Sorry I'm asking too many questions in a row. I have a list of
I have long cycles of GC. from checks I saw there are too many

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.