Bootstrap 模板在 MVC 应用程序中不起作用

拉吉

我正在尝试Bootstrap templatehttps://bootswatch.com/superhero/ Bootstrap Bootstrap免费使用从这个网站复制bootstrap.cssbootstrap.min.css粘贴到我的应用程序中,但我的应用程序没有navbar像这个模板那样显示请从本网站和我的主页中找到随附的屏幕截图。

从这个网站: 在此处输入图片说明

从我的应用程序:

在此处输入图片说明

我的_Layout.cs

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                </ul>
                @Html.Partial("_LoginPartial")
            </div>
        </div>
    </div>
    <div class="container body-content">
        @RenderBody()
        <hr />
        <footer>
            <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
        </footer>
    </div>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>

我的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/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/bootstrap").Include(
    "~/Content/bootstrap.css",
    "~/Content/bootstrap-theme.css"));

            bundles.Add(new StyleBundle("~/Content/css").Include(
                      "~/Content/bootstrap.css",
                      "~/Content/site.css"));
        }
    }

任何建议都受到高度赞赏。谢谢你。

TC55

您可能使用的 Bootstrap 版本与用于 Bootswatch 主题的版本不同。我遇到了同样的问题并在 Github 上打开了一个问题,Thomas Park 在那里给了我以下答案:

是的,只需确保您使用的版本与正在使用的 Bootstrap 相同。现在 v4 在 bootswatch.com 上,但您可以在https://bootswatch.com/3/https://bootswatch.com/2/获取旧版本

因此,尝试更新您的 Bootstrap 版本使用您想要的 Bootswatch 主题的先前版本(来自上面的链接)。

来源:https : //github.com/thomaspark/bootswatch/issues/784

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Bootstrap在Rails应用程序中不起作用

来自分类Dev

注销按钮在MVC应用程序中不起作用

来自分类Dev

mvc 应用程序日历在 IE 中不起作用

来自分类Dev

Bootstrap在管理模板下不起作用

来自分类Dev

余烬应用程序模板不起作用

来自分类Dev

Bootstrap 可折叠在我的模板中不起作用

来自分类Dev

AngularJS:模板中的第二个应用程序不起作用

来自分类Dev

Spring MVC Web应用程序中的模板

来自分类Dev

具有模板的MVC应用程序中的AngularJS路由

来自分类Dev

MVC 4应用程序中的ELMAH,在Global.asax中不起作用

来自分类Dev

UI Bootstrap在ASP-MVC中不起作用

来自分类Dev

bootstrap-datetimepicker.js在MVC 5中不起作用

来自分类Dev

为什么DataFormatString在我的MVC应用程序中不起作用?

来自分类Dev

Web(MVC)应用程序中的AbotX许可证文件不起作用

来自分类Dev

url-pattern在Spring MVC应用程序中不起作用

来自分类Dev

在VStudio MVC 5应用程序的html页面中对CSS的引用不起作用

来自分类Dev

.subscribe在我的ASP.NET MVC应用程序中不起作用

来自分类Dev

动作侦听器在MVC应用程序中不起作用

来自分类Dev

Web(MVC)应用程序中的AbotX许可证文件不起作用

来自分类Dev

dotnet 包在 .net 核心 mvc 应用程序中不起作用

来自分类Dev

Spring 启动 POST 请求在 Spring MVC 应用程序中不起作用

来自分类Dev

MVC 5 Bootstrap模板smartadmin-renderbody

来自分类Dev

bootstrap 3模板更改mvc5

来自分类Dev

Spring MVC和Twitter Bootstrap模板

来自分类Dev

log4net的SQL附加程序在MVC5应用程序中不起作用

来自分类Dev

如何将 Bootstrap 模板应用到 MVC 项目中

来自分类Dev

在Meteor应用程序内实现Bootstrap模板

来自分类Dev

用于MVC Windows应用程序的Visual Studio项目模板

来自分类Dev

角度引导问题angular.bootstrap在我的应用程序上不起作用

Related 相关文章

  1. 1

    Bootstrap在Rails应用程序中不起作用

  2. 2

    注销按钮在MVC应用程序中不起作用

  3. 3

    mvc 应用程序日历在 IE 中不起作用

  4. 4

    Bootstrap在管理模板下不起作用

  5. 5

    余烬应用程序模板不起作用

  6. 6

    Bootstrap 可折叠在我的模板中不起作用

  7. 7

    AngularJS:模板中的第二个应用程序不起作用

  8. 8

    Spring MVC Web应用程序中的模板

  9. 9

    具有模板的MVC应用程序中的AngularJS路由

  10. 10

    MVC 4应用程序中的ELMAH,在Global.asax中不起作用

  11. 11

    UI Bootstrap在ASP-MVC中不起作用

  12. 12

    bootstrap-datetimepicker.js在MVC 5中不起作用

  13. 13

    为什么DataFormatString在我的MVC应用程序中不起作用?

  14. 14

    Web(MVC)应用程序中的AbotX许可证文件不起作用

  15. 15

    url-pattern在Spring MVC应用程序中不起作用

  16. 16

    在VStudio MVC 5应用程序的html页面中对CSS的引用不起作用

  17. 17

    .subscribe在我的ASP.NET MVC应用程序中不起作用

  18. 18

    动作侦听器在MVC应用程序中不起作用

  19. 19

    Web(MVC)应用程序中的AbotX许可证文件不起作用

  20. 20

    dotnet 包在 .net 核心 mvc 应用程序中不起作用

  21. 21

    Spring 启动 POST 请求在 Spring MVC 应用程序中不起作用

  22. 22

    MVC 5 Bootstrap模板smartadmin-renderbody

  23. 23

    bootstrap 3模板更改mvc5

  24. 24

    Spring MVC和Twitter Bootstrap模板

  25. 25

    log4net的SQL附加程序在MVC5应用程序中不起作用

  26. 26

    如何将 Bootstrap 模板应用到 MVC 项目中

  27. 27

    在Meteor应用程序内实现Bootstrap模板

  28. 28

    用于MVC Windows应用程序的Visual Studio项目模板

  29. 29

    角度引导问题angular.bootstrap在我的应用程序上不起作用

热门标签

归档