Webforms 捆绑不在页面上注册脚本

Webforms bundling not registering scripts on page

捆绑配置:

Public Class BundleConfig
    ' For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkID=303951
    Public Shared Sub RegisterBundles(ByVal bundles As BundleCollection)
        bundles.Add(New ScriptBundle("~/bundles/WebFormsJs").Include(
                        "~/Scripts/WebForms/WebForms.js",
                        "~/Scripts/WebForms/WebUIValidation.js",
                        "~/Scripts/WebForms/MenuStandards.js",
                        "~/Scripts/WebForms/Focus.js",
                        "~/Scripts/WebForms/GridView.js",
                        "~/Scripts/WebForms/DetailsView.js",
                        "~/Scripts/WebForms/TreeView.js",
                        "~/Scripts/WebForms/WebParts.js"))

        ' Order is very important for these files to work, they have explicit dependencies
        bundles.Add(New ScriptBundle("~/bundles/MsAjaxJs").Include(
                "~/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
                "~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
                "~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
                "~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"))

        ' Use the Development version of Modernizr to develop with and learn from. Then, when you’re
        ' ready for production, use the build tool at http://modernizr.com to pick only the tests you need
        bundles.Add(New ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"))

        bundles.Add(New ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.min.js"
                    ))

        bundles.Add(New ScriptBundle("~/bundles/bootstrap").Include(
                        "~/Scripts/bootstrap.min.js"
                    ))

        ScriptManager.ScriptResourceMapping.AddDefinition("respond", New ScriptResourceDefinition() With {
                .Path = "~/Scripts/respond.min.js",
                .DebugPath = "~/Scripts/respond.js"})

    End Sub
End Class

申请开始:

Sub Application_Start(sender As Object, e As EventArgs)
        ' Fires when the application is started
        RouteConfig.RegisterRoutes(RouteTable.Routes)
        BundleConfig.RegisterBundles(BundleTable.Bundles)
        BundleTable.EnableOptimizations = True
        Dim builder = New ContainerBuilder()

        RegisterTypes(builder)

        'Setup container with builder
        _containerProvider = New ContainerProvider(builder.Build())
    End Sub

主页标题:

<head runat="server">
    <title></title>
    <!-- standard NCCI meta tags -->
    <meta name="AUTHOR" content="NCCI" />
    <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />
    <meta http-equiv="PRAGMA" content="NO-CACHE" />
    <meta name="ROBOTS" content="NONE" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

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

我的项目中也安装了网络优化。为什么没有任何 scrips/styles 在页面上呈现?

捆绑配置中的文件路径引用了正确的文件,所以我不知道为什么它不起作用。

<% Scripts.... 等缺少冒号。 它应该读作 <%: Scripts.Render