Kendo projects and MVC bundling

3 posts, 0 answers
  1. Adam
    Adam avatar
    24 posts
    Member since:
    Nov 2011

    Posted 12 Feb 2013 Link to this post

    When starting or converting a project to a Kendo MVC project, the css and js are copied into a "kendo/(build#)" folder within the "Content" and "Scripts" folders respectively.

    Your documentation on using MVC bundling with Kendo works just fine. My only issue is it requires the css/js to be in the root "Content" and "Scripts" folders and not where they are put by default.

    I'm just trying to understand this because the project layout conflicts with your documentation. I have tried the bundling when the files are where the wizard puts them and I could not get it to work. Are we supposed to just manually copy/dupe the content each release?

    Ideally a nuget package for the MVC wrappers would be used, but I just want to know how to best work around the way it currently is.
  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 13 Feb 2013 Link to this post

    Hi Adam,

     Indeed the documentation help topic currently doesn't show how to use ASP.NET bundles when the scripts and themes of Kendo UI are in ~/scripts/kendo/{version} and ~/content/kendo/{version} (which is where they are copied by the Visual Studio extensions by default). We will update our documentation shortly.

     Here is how you should register your bundles:

    bundles.Add(new ScriptBundle("~/bundles/kendo")
    bundles.Add(new StyleBundle("~/Content/kendo/2012.3.1315/css")
    // Clear all items from the default ignore list to allow minified CSS and JavaScript files to be included in debug mode
    // Add back the default ignore list rules sans the ones which affect minified files and debug mode
    bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);

    And here is how to use them:

    For your convenience I have attached a runnable sample project.

    All the best,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Adam
    Adam avatar
    24 posts
    Member since:
    Nov 2011

    Posted 14 Feb 2013 Link to this post

    Thanks Atanas,

    I used this method and it is working well.
Back to Top