MVC bundeling : Err 403

我的梦境 提交于 2019-12-01 03:04:06

Try changing

bundles.Add(new StyleBundle("~/Content/kendo").Include(
            "~/Content/kendo/kendo.common.*",
            "~/Content/kendo/kendo.default.*"));

to

bundles.Add(new StyleBundle("~/bundles/css/kendo").Include(
            "~/Content/kendo/kendo.common.*.css",
            "~/Content/kendo/kendo.default.*.css"));

and then

@Styles.Render("~/Content/kendo")

to

@Styles.Render("~/bundles/css/kendo")

it's because you're using the same 'alias' (/Content/kendo) for the stylebundle as the already existing directory.

once you use another alias (/Content/css/kendo/ or /Content/whatevernonexistingdir) your problem is solved.

but be aware: the 'root' of the css is changed, so when using (background) images in your css which are pointing to subfolders, take this into account!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!