I have the following configured
Class called BudleConfig in the App_Code Folder
Imports System.Web.Optimization
Public Class BundleConfig
Public Shared Sub RegisterBundles(bundles As BundleCollection)
bundles.Add(New ScriptBundle("~/bundles/WerbFormsJs").Include(
"~/js/Global.min.js",
"~/js/bootstrp.min.js"
))
End Sub
End Class
Next in a Global.asax
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
BundleConfig.RegisterBundles(BundleTable.Bundles)
End Sub
Finally in the Header User Control used on all pages
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/WerbFormsJs") %>
</asp:PlaceHolder>
However, Scripts is giving me Build Errors - 'Scripts' is not declared. It may be inaccessible due to its protection level.
I also added the following to the Web.config
<pages>
<namespaces>
<add namespace="System.Web.Optimization" />
</namespaces>
</pages>