0

I am using kendo UI for ASP.NET MVC. I have bundled all the kendo JS files. Locally its working fine. But when i deployed the application to the web server and then when i browse the page i noticed the kendo javascripts are not bundled and because of that i am getting error

Uncaught TypeError: jQuery(...).kendoDropDownList is not a function

This is how i am bundling the files Bundled Files

This is how i am referencing them in _Layout.cshtml

        @Styles.Render("~/Content/bootstrap/css")
        @Styles.Render("~/Content/kendo-bootstrap/css")
        @Styles.Render("~/Content/css")
        <link rel="stylesheet" href="~/Content/bootstrap-multiselect.css" type="text/css" />


        @Scripts.Render("~/bundles/jquery")
        @Scripts.Render("~/bundles/kendo/2016.1.412")
        @Scripts.Render("~/bundles/bootstrap")
        @Scripts.Render("~/bundles/modernizr")
        <script type="text/javascript" src="~/Scripts/bootstrap-multiselect.js"></script>

This is what i see in browser's F12 -> Source Tab

enter image description here

Note that jQuery,Modernizer and Bootstrap is bundled but not kendo. Why?

LP13
  • 30,567
  • 53
  • 217
  • 400
  • do the files exist on the server you are deploying the application too? It maybe that the folder and subsequent files are set to `Do not copy' for the Copy to Output Directory. – David Shorthose May 11 '16 at 10:15
  • file does exists on the server – LP13 May 11 '16 at 15:52
  • I have noticed on your include the kendo.timezones.min.js file appears to have an extra `s` at the end of it. (may be nothing but just wanted to point it out just incase that is the issue) - locally you might be using a cached version which worked previously – David Shorthose May 11 '16 at 16:28
  • well removed that extra `s` however no luck :( – LP13 May 11 '16 at 17:05
  • one more thing. I am using Jenkins + MSBuild + Publish options. So i basically i have created publish file which uses "File System" as publish method. and then i use MSBuild to build and publish the application. – LP13 May 11 '16 at 17:10
  • There is discuss here `http://stackoverflow.com/questions/11980458/bundler-not-including-min-files/12901050#12901050` about why MVC is not bundling .min files..however there is no solution for it – LP13 May 11 '16 at 17:33

1 Answers1

1

so finally it started working..i have followed the telerik's article here The only difference in that article vs what i was doing was:

JS file location in project: Mine was ~/Scripts/kendo/2016.1.412 and suggested ~/Sripts/kendo
CSS file location in project: Mine was ~/Content/kendo/2016.1.412 and suggested ~/Content/kendo

Also in BundleConfig.cs file
JS Bundle Script Name: Mine was ~/bundles/kendo/2016.1.412 and suggested ~/bundles/kendo
CSS Bundle Script Name: Mine was ~/Content/kendo-bootstrap/css and suggested ~/Content/kendo/css

i dont know why would this make a difference, because ultimately i was referencing to correct bundle names in layout.cshtml

but anyway above changes worked for me

LP13
  • 30,567
  • 53
  • 217
  • 400