<webopt:BundleReference> renders ScriptBundle as css link elements

跟風遠走 提交于 2019-12-05 11:33:54

I'm using VS2012 and .Net 4.5. I do npt use the webopt control. I render like this:

<head>
  <asp:PlaceHolder runat="server">
    <%: Styles.Render("~/Content/MainContentCSS") %>
    <%: Scripts.Render("~/bundles/jqueryPlus") %>
  </asp:PlaceHolder>
</head>

where my css and js are also defined in BundleConfig.vb as:

bundles.Add(New ScriptBundle("~/bundles/jqueryPlus").Include(
            "~/Scripts/modernizr-{version}.js",
            "~/Scripts/jquery-{version}.js",
            "~/Scripts/jquery-ui-{version}.js",
            "~/ig_ui/js/infragistics.js",
            "~/Site.Master.js"))

bundles.Add(New StyleBundle("~/Content/MainContentCSS").Include(
                  "~/Content/Site.css",
                  "~/Content/Site-overrides.min.css",
                  "~/Content/rs-custom-controls.min.css",
                  "~/ig_ui/css/structure/infragistics.css",
                  "~/Examiner/Claim.master.min.css"))

And renders as:

<link href="/Content/Site.css" rel="stylesheet"/>
<link href="/Content/Site-overrides.min.css" rel="stylesheet"/>
<link href="/Content/rs-custom-controls.min.css" rel="stylesheet"/>
<link href="/ig_ui/css/structure/infragistics.css" rel="stylesheet"/>
<link href="/Examiner/Claim.master.min.css" rel="stylesheet"/>
<script src="/Scripts/jquery-2.1.3.js"></script>
<script src="/Scripts/jquery-ui-1.11.2.js"></script>
<script src="/Scripts/modernizr-2.8.3.js"></script>
<script src="/ig_ui/js/infragistics.js"></script>
<script src="/Site.Master.js"></script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!