Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 4 下拉菜单不适用于UI引导和引导样例模板_Asp.net Mvc 4_Angular Ui Bootstrap_Bootswatch - Fatal编程技术网

Asp.net mvc 4 下拉菜单不适用于UI引导和引导样例模板

Asp.net mvc 4 下拉菜单不适用于UI引导和引导样例模板,asp.net-mvc-4,angular-ui-bootstrap,bootswatch,Asp.net Mvc 4,Angular Ui Bootstrap,Bootswatch,您好,我正在尝试使用UI引导和引导样例模板设置angular应用程序。bootswatch模板正在整个站点上应用,但是当我尝试设置下拉菜单、手风琴或导航折叠时,似乎什么都不起作用。导航折叠与导航一起工作,可以折叠按钮,但单击按钮没有任何作用,没有下拉列表等。我在Chrome开发工具中没有发现任何错误,我可以看到所有请求的脚本和CSS都加载到页面中。虽然这是一个SPA,但我将其包装在MVC4站点中。这是我到目前为止为基础cshtml模板所使用的html <!DOCTYPE html>

您好,我正在尝试使用UI引导和引导样例模板设置angular应用程序。bootswatch模板正在整个站点上应用,但是当我尝试设置下拉菜单、手风琴或导航折叠时,似乎什么都不起作用。导航折叠与导航一起工作,可以折叠按钮,但单击按钮没有任何作用,没有下拉列表等。我在Chrome开发工具中没有发现任何错误,我可以看到所有请求的脚本和CSS都加载到页面中。虽然这是一个SPA,但我将其包装在MVC4站点中。这是我到目前为止为基础cshtml模板所使用的html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <title>@ViewBag.Title</title>

    <!--Remove for bundles on publish-->
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    @if (IsSectionDefined("AdditionalHeadContent"))
    {
        @RenderSection("AdditionalHeadContent", required: false)
    }
    <style type="text/css">
        .bs-spacer{margin:40px;}
    </style>
    @Scripts.Render("~/bundles/modernizr")
</head>
<body>
    <div class="bs-spacer">  
            <nav role="navigation" class="navbar navbar-default">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a href="#" class="navbar-brand">Brand</a>

                </div>
                <!-- Collection of nav links and other content for toggling -->
                <div id="navbarCollapse" class="collapse navbar-collapse">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="#">Home</a></li>
                        <li><a href="#">Link 1</a></li>
                        <li><a href="#">Link 2</a></li>
                    </ul>
                    <ul class="nav navbar-nav">
                        <li class="dropdown">
                            <a id="itemActionMenu" role="presentation" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">Dropdown <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu" aria-labelledby="itemActionMenu">
                                <li role="presentation"><a role="menuitem" tabindex="-1">Action 1</a></li>
                                <li role="presentation"><a role="menuitem" tabindex="-1">Action 2</a></li>
                            </ul>
                        </li>
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="#">Login</a></li>
                    </ul>
                </div>
            </nav>
            @RenderBody()

    </div>
    <!--Remove for bundles on publish-->

    @Scripts.Render("~/Scripts/angular.min.js")
    @Scripts.Render("~/Scripts/angular-ui/ui-bootstrap-tpls.min.js")
    @Scripts.Render("~/Scripts/angular-animate.min.js")
    @RenderSection("scripts", required: false)
</body>
</html>

@视图包。标题
@if(IsSectionDefined(“AdditionalHeadContent”))
{
@RenderSection(“AdditionalHeadContent”,必填项:false)
}
.bs间隔符{边距:40px;}
@Scripts.Render(“~/bundles/modernizer”)
切换导航
@RenderBody() @Scripts.Render(“~/Scripts/angular.min.js”) @Scripts.Render(“~/Scripts/angular ui/ui bootstrap tpls.min.js”) @Scripts.Render(“~/Scripts/angular animate.min.js”) @RenderSection(“脚本”,必需:false)
对我可能遗漏的内容有什么建议吗?因为我使用的是UI引导,所以不需要jquery,所以列表中没有它。(我确实测试了它并添加了它,但结果相同)


提前感谢

出现此问题的最常见原因是bootstrap.js文件也正在加载。不要将TWBS javascript库与angular ui引导库一起使用。@RobJ不幸的是,这里的情况并非如此。我甚至没有将引导框架添加到这个项目中,只有来自nuget的UI引导。