0

I tried to add a few scripts at the same bundle

bundles.Add(new ScriptBundle("~/bundles/scripts").Include("~/Scripts/jquery.nivo.slider.pack.js",
            "~/Scripts/jquery.jcarousel.min.js",
            "~/Scripts/jquery.jcarousel-control.min.js",
            "~/Scripts/jquery.jcarousel-autoscroll.min.js"));

but as result I got on my page only one, the first script

<script src="/Scripts/jquery.nivo.slider.pack.js"></script>

(Of course, I added all scripts in Scripts folder.)
What's wrong? How can I fix it?

2 Answers 2

1

Chain the Include calls:

bundles.Add(new ScriptBundle("~/bundles/scripts")
    .Include("~/Scripts/jquery.nivo.slider.pack.js")
    .Include("~/Scripts/jquery.jcarousel.min.js")
    .Include("~/Scripts/jquery.jcarousel-control.min.js")
    .Include("~/Scripts/jquery.jcarousel-autoscroll.min.js"))
Sign up to request clarification or add additional context in comments.

1 Comment

but why othes script bundles work without Include, for example, bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.unobtrusive*", "~/Scripts/jquery.validate*")); and the same about css bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/reset.css", "~/Content/style.css", "~/Content/nivo-slider.css", "~/Content/ie8-style.css")); ?
0

Try this,

bundles.Add(new ScriptBundle("~/bundles/Yourscripts").Include(
            "~/Scripts/jquery.nivo.slider.pack.js",
            "~/Scripts/jquery.jcarousel.min.js",
            "~/Scripts/jquery.jcarousel-control.min.js",
            "~/Scripts/jquery.jcarousel-autoscroll.min.js"));

And It works.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.