ASP.NET MVC 5无法呈现jQuery UI CSS包
发布时间:2020-12-16 04:26:10 所属栏目:asp.Net 来源:网络整理
导读:我想在我的项目中包含jQuery UI CSS主题包.我在?/ Content / themes目录中有所有必需的文件,并按如下方式设置我的BundleConfig.cs: public class BundleConfig{ // For more information on bundling,visit http://go.microsoft.com/fwlink/?LinkId=301862
我想在我的项目中包含jQuery UI CSS主题包.我在?/ Content / themes目录中有所有必需的文件,并按如下方式设置我的BundleConfig.cs:
public class BundleConfig { // For more information on bundling,visit http://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include( "~/Scripts/jquery-ui-{version}.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.validate*")); // 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/bootstrap").Include( "~/Scripts/bootstrap.js","~/Scripts/respond.js")); bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css","~/Content/site.css")); bundles.Add(new StyleBundle("~/Content/themes/base/css").Include( "~/Content/themes/base/jquery.ui.core.css","~/Content/themes/base/jquery.ui.resizable.css","~/Content/themes/base/jquery.ui.selectable.css","~/Content/themes/base/jquery.ui.accordion.css","~/Content/themes/base/jquery.ui.autocomplete.css","~/Content/themes/base/jquery.ui.button.css","~/Content/themes/base/jquery.ui.dialog.css","~/Content/themes/base/jquery.ui.slider.css","~/Content/themes/base/jquery.ui.tabs.css","~/Content/themes/base/jquery.ui.datepicker.css","~/Content/themes/base/jquery.ui.progressbar.css","~/Content/themes/base/jquery.ui.theme.css")); } } 我的_Layout.cshtml有以下< head>: <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>@ViewBag.Title</title> <link href="//fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet" type="text/css"> @Styles.Render("~/Content/themes/base/css","~/Content/css","~/Content/datepicker3.css") @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/jqueryui") @Scripts.Render("~/bundles/bootstrap") @Scripts.Render("~/bundles/modernizr") @Scripts.Render("~/Content/bootstrap-datepicker.js") @RenderSection("head",required: false) <link rel="icon" href="@Url.Content("~/Content/favicon.ico")" /> </head> 但是,这是发出的HTML(注意缺少jQuery CSS主题): <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title></title> <link href="//fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet" type="text/css"> <link href="/PackageManager/Content/bootstrap.css" rel="stylesheet"/> <link href="/PackageManager/Content/site.css" rel="stylesheet"/> <link href="/PackageManager/Content/datepicker3.css" rel="stylesheet"/> <script src="/PackageManager/Scripts/jquery-1.10.2.js"></script> <script src="/PackageManager/Scripts/jquery-ui-1.11.3.js"></script> <script src="/PackageManager/Scripts/bootstrap.js"></script> <script src="/PackageManager/Scripts/respond.js"></script> <script src="/PackageManager/Scripts/modernizr-2.6.2.js"></script> <script src="/PackageManager/Content/bootstrap-datepicker.js"></script> <link rel="icon" href="/PackageManager/Content/favicon.ico" /> </head> 这是我的解决方案结构: 我错过了什么? 解决方法
除非我遗漏了某些内容,否则看起来你的文件都没有以jquery.ui为前缀,但在你的BundleConfig中它们是.
例如,您在BundleConfig中使用jquery.ui.core.css,但解决方案资源管理器中的文件名为core.css. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-core – 构建asp.net核心错误
- asp.net – Azure应用程序中的4分钟超时
- 端到ASP.NET MVC的推荐方法
- 写入ASP.NET中的日志文件
- asp.net-mvc – mvc asp.net中的自定义成员资格提供程序或配
- asp.net-mvc – 具有预设值的Html.HiddenFor
- ASP.NET Cookies BUG – 多个cookie随机复制?
- asp.net在Server.Transfer之后如何获取当前页面的路径?
- Asp.Net Core 2.0 生成操作数据库文件需要的文件
- asp.net-mvc – 我可以使用MVC全局动作过滤器来禁用表单字段
推荐文章
站长推荐
- asp.net – 仅限RadComboBox下拉列表
- asp.net-mvc-3 – DTO可以嵌套DTO吗?
- 从ASP.Net中的sessionID获取会话对象
- asp.net – 重定向到一个页面,其endResponse为tr
- asp.net – 如果我只是在做一个查找表,我应该使用
- asp.net – Web.config Build vs Release transf
- asp.net-mvc – 未找到部分视图“First.cshtml”
- 从ASP.Net页面通过C#将NetworkCredential传递给H
- Asp.Net MVC 3部分页面输出缓存不符合配置设置
- asp.net-core – 我可以在ASP.net Core 2.0 Prev
热点阅读