mvc bundle功能(2)
配置好Bundle,注册好之后,再是调用
1 <head> 2 <meta charset="utf-8"> 3 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 4 <meta name="viewport" content="width=device-width, initial-scale=1"> 5 <meta name="description" content=""> 6 <meta name="author" content=""> 7 <link rel="icon" href="../../favicon.ico"> 8 9 <title>Dashboard Template for Bootstrap</title>10 11 <!-- Bootstrap core CSS --> 12 <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet" /> 13 <!-- Custom styles for this template --> 14 <link href="/css/dashboard.css" rel="stylesheet" /> 15 @*<script src="/assets/global/plugins/jquery-1.11.0.min.js"></script> 16 <script src="/Scripts/jquery-ui-1.8.20.min.js"></script>*@ 17 @Scripts.Render("~/bundles/jquery") 18 @Scripts.Render("~/bundles/jqueryval") 19 @RenderSection("head", false) 20 @*<link href="/Content/kendo.common.min.css" rel="stylesheet"> 21 <link href="/Content/kendo.rtl.min.css" rel="stylesheet"> 22 <link href="/Content/kendo.default.min.css" rel="stylesheet"> 23 <link href="/Content/kendo.dataviz.min.css" rel="stylesheet"> 24 <link href="/Content/kendo.dataviz.default.min.css" rel="stylesheet"> 27 <script src="/Scripts/kendo/kendo.all.min.js"></script> 28 <script src="/Scripts/kendo/cultures/kendo.culture.zh-CN.min.js"></script> 29 <script src="/Scripts/kendo/kendo.aspnetmvc.min.js"></script>*@ 30 31 @Styles.Render("~/Content/kendo/css") 32 @Scripts.Render("~/bundles/kendo") 33 <script type="text/javascript"> 34 //set current to the "en-GB" culture script 35 kendo.culture("zh-CN"); 36 </script> 37 </head>
引用起来是不是很简单?当然要使bundle最终生效,还得再web.config中配置下,把debug改为false
<compilation debug="false" targetFramework="4.5"/>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。