0
I am trying to load the CSS files jquery-ui.css and jquery-ui.theme.css creating a Bundles, but Bundle insists on only loading the standard CSS of ASP.NET MVC which css site.. To work, I always have to load the additional CSS files using the tag <link>
. Where am I going wrong?
Bundleconfig
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
BundleTable.EnableOptimizations = true;
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js",
"~/Scripts/jquery-ui.js",
"~/Scripts/jquery.dialogo.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.css",
"~/Content/themes/base/jquery.ui.theme.css"));
}
}
_Layout.cshtml
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@*<link href="~/Content/themes/base/css/jquery-ui.css" rel="stylesheet" />
<link href="~/Content/themes/base/css/jquery-ui.theme.css" rel="stylesheet" />*@
@Styles.Render("~/Content/themes/base/css", "~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<h2>Menu Sistema</h2>
@RenderPage("~/Views/Shared/_Menu.cshtml")
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
@RenderSection("scripts", required: false)
</body>
</html>
CSS files
Gypsy, I made the adjustments and it didn’t work. I think there’s something else I did wrong.
– Kelly Soares
Missed. I edited the answer. See now.
– Leonel Sanches da Silva
It worked. Thank you Gypsy!
– Kelly Soares