Я интегрировал шаблон величественного пользовательского интерфейса в мой новый проект ASP.NET MVC.
http://www.urbanui.com/majestic/template/pages/ui-features/typography.html
Но JavaScript не работает после интеграции. Я имею в виду переключение боковой панели и загрузчик не работает должным образом. Я создал _AdminLayout.cshtml вид изнутри -> общая папка.
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>@ViewBag.Title</title>
<!-- plugins:css -->
@Styles.Render("~/vendors/base/vendor.bundle.base.css")
@Styles.Render("~/vendors/mdi/css/materialdesignicons.min.css")
<link rel="stylesheet" href="../../vendors/mdi/css/materialdesignicons.min.css">
@*<link rel="stylesheet" href="../../vendors/base/vendor.bundle.base.css">*@
<!-- endinject -->
<!-- plugin css for this page -->
<!-- End plugin css for this page -->
<!-- inject:css -->
@Styles.Render("~/css/style.css")
<link rel="stylesheet" href="../../css/style.css">
<!-- endinject -->
<link rel="shortcut icon" href="../../images/favicon.png" />
</head>
<body>
<!-- container-scroller -->
<!-- plugins:js -->
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/vendors/base/vendor.bundle.base.js")
@*<script src="../../vendors/base/vendor.bundle.base.js"></script>*@
<!-- endinject -->
<!-- inject:js -->
@Scripts.Render("~/js/off-canvas.js")
@*<script src="../../js/off-canvas.js"></script>*@
@Scripts.Render("~/js/hoverable-collapse.js")
@*<script src="../../js/hoverable-collapse.js"></script>*@
@Scripts.Render("~/js/template.js")
@*<script src="../../js/template.js"></script>*@
@Scripts.Render("~/bundles/jqueryval")
@RenderSection("scripts", required:false)
<!-- endinject -->
<!-- Custom js for this page-->
<script src="../../js/file-upload.js"></script>
<!-- End custom js for this page-->
</body>
</html>
код для конфигурации пакета
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{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"));
//for admin layout
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/vendors/base/vendor.bundle.base.js",
"~/js/off-canvas.js ",
"~/js/hoverable-collapse.js",
"~/js/template.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/vendors/base/vendor.bundle.base.css",
"~/vendors/mdi/css/materialdesignicons.min.css",
"~/css/style.css"));
}
Я также приложил файл изображения структуры проекта.