Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo MVC not Displaying Sprites.PNG 404 Error

Vs'12 Internet Application Template + KendoUI - MVC4 , EF Code First

  • Followed KendoDocumentation
  • Adjusted using kahanu's Awesome post
  • Everything worked great, so i turn <compilation debug="false" targetFramework="4.5"> from true to false
  • Kendo UI stopped finding Spites.png ( by Kendo )
  • Went looking and found this ( didn't resolve my issue ): stackOverflow1
  • Checked and Rechecked Steps 1-2, went looking for Sprites.png on the server, It exists.. but in some subolder of Kendo not in the directory below? /

Where do I re-write the code and have it look for the sprite in the actual location rather than this one?: GET http://cls-og.com/bundles/css/Default/sprite.png 404 (Not Found)

like image 206
Don Thomas Boyle Avatar asked Sep 20 '13 19:09

Don Thomas Boyle


2 Answers

I think your problem is in bundles, that's why it works great on debug (without bundles therefore) but not on release mode.

My advice is to put kendo styles folder on Content and create the bundle at the same place.

For example:

BundleTable.Bundles.Add(new StyleBundle("~/Content/kendo/kendo").Include(
            "~/Content/kendo/kendo.common.min.css",
            "~/Content/kendo/kendo.dataviz.min.css",
            "~/Content/kendo/kendo.default.min.css",
            "~/Content/kendo/kendo.dataviz.default.min.css"
        ));

Another tip: to avoid bundle problems in the future insert this in RegisterBundles method:

        BundleTable.EnableOptimizations = true;

That forces bundeling also in debug mode!

Hope this helps!

Have a nice day,

Alberto

like image 147
Alberto Avatar answered Oct 23 '22 06:10

Alberto


I had the similar issue with sprite.png and following is what did to resolve the issue.

This is how my bundling code looked like before I faced the issue.

bundles.Add(new StyleBundle("~/Kendo/css").Include(
                "~/Content/kendo/2016.2.504/kendo.common.min.css",
                "~/Content/kendo/2016.2.504/kendo.rtl.min.css",
                "~/Content/kendo/2016.2.504/kendo.default.min.css",
                "~/Content/kendo/2016.2.504/kendo.dataviz.min.css",
                "~/Content/kendo/2016.2.504/kendo.dataviz.default.min.css",
                "~/Content/jquery-ui.css"));

<!--KENDO CSS LINKING ON VIEW-->
@Styles.Render("~/Kendo/css")

I referred to kahanu's blog and made following changes and it worked perfectly for me.

bundles.Add(new StyleBundle("~/Content/kendo/2016.2.504/kendostyles").Include(
                "~/Content/kendo/2016.2.504/kendo.common.min.css",
                "~/Content/kendo/2016.2.504/kendo.rtl.min.css",
                "~/Content/kendo/2016.2.504/kendo.default.min.css",
                "~/Content/kendo/2016.2.504/kendo.dataviz.min.css",
                "~/Content/kendo/2016.2.504/kendo.dataviz.default.min.css",
                "~/Content/jquery-ui.css"));
<!--KENDO CSS LINKING ON VIEW-->
@Styles.Render("~/Content/kendo/2016.2.504/kendostyles")

Hope this will help others.

like image 29
Sikandar Amla Avatar answered Oct 23 '22 08:10

Sikandar Amla