ASP.NET MVC 5无法呈现jQuery UI CSS包
发布时间:2020-05-28 14:30:33 所属栏目:asp.Net 来源:互联网
导读:我想在我的项目中包含jQuery UI CSS主题包.我在/ Content / themes目录中有所有必需的文件,并按如下方式设置我的BundleConfig.cs: public class BundleConfig{ // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId
|
我想在我的项目中包含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. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- OWIN上的CORS和访问/令牌导致“Access-Control-Allow-Origi
- asp.net-mvc – 在ASP.NET MVC 3中等效的Flash
- asp.net-mvc-4 – 将nopcommerce 2.8升级到3.10
- asp.net – 如果在Application_Start中抛出未处理的异常会发
- asp.net – 来自WebHttpBinding的WCF服务中的Access Sessio
- asp.net – 使用Visual Studio 2017在.NET Core解决方案上没
- asp.net – 实体框架:“底层提供商在Open上失败”
- asp.net-mvc-3 – MailTo链接在Razor
- asp.net-mvc – Mvc Mini Profiler请求带有和不带有RouteBa
- asp.net-mvc – 如何为mvc应用程序中的所有控制器启用ssl
推荐文章
站长推荐
热点阅读
