2
我正在嘗試捆綁我的asp.net web應用程序的css & js。 CSS工作正常,但它也把CSS文件作爲CSS。可能是我做了一些錯誤配置。當我翻看我的應用程序&看頁面源時,它會給出這樣的節目。在asp.net應用程序的Bundle.config中包含js
<link href="/Content/bootstrap.css" rel="stylesheet"/>
<link href="/Content/Site.css" rel="stylesheet"/>
<link href="/Content/owlcarousel.css" rel="stylesheet"/>
<link href="/Scripts/jquery.js" rel="stylesheet"/>
<link href="/Scripts/owlcarousel.js" rel="stylesheet"/>
Bundle.config
<?xml version="1.0" encoding="utf-8" ?>
<bundles version="1.0">
<styleBundle path="~/Content/css">
<include path="~/Content/bootstrap.css" />
<include path="~/Content/Site.css" />
<include path="~/Content/owlcarousel.css" />
</styleBundle>
<scriptBundle path="~/Scripts/js">
<include path="~/Scripts/jquery.js" />
<include path="~/Scripts/owlcarousel.js" />
</scriptBundle>
</bundles>
母版
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/modernizr") %>
</asp:PlaceHolder>
<webopt:bundlereference runat="server" path="~/Content/css" />
<webopt:bundlereference runat="server" path="~/Scripts/js" />
@ H.Pauwelyn〜/ Content/css是僅包含css文件的目錄。 〜/ Scripts/js用於JS – SUN