我是asp的新手,我在导航栏崩溃时遇到麻烦,它在主页(AnonymousTemplate)中工作正常,但是当我登录导航栏时折叠不起作用(单击时不展开)。这是我的代码,我是新来的,所以请保持温柔。对不起,这个问题。
感谢所有愿意回答的人,我们将不胜感激。
这是我的脚本和HTML。
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/jquery.prettyPhoto.js" type="text/javascript"></script>
<script src="js/jquery.isotope.min.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
<script src="js/wow.min.js" type="text/javascript"></script>
&#13;
<nav class="navbar navbar-inverse" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="Default.aspx"><asp:Image ID="Image1" runat="server" ImageUrl="~/images/service/logo.png"></asp:Image></a>
</div>
<div runat="server" class="collapse navbar-collapse navbar-right">
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<ul class="nav navbar-nav">
<li><a href="Default.aspx">Home</a></li>
<li><a href="HowItWorks.aspx" >How it works?</a></li>
<li><a href="ContactUs.aspx">Contact us</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">About us <i class="fa fa-angle-down"></i></a>
<ul class="dropdown-menu">
<li><a href="Secure/Default.aspx">Our Customers</a></li>
<li><a href="#">Our Truckers</a></li>
<li><a href="#">Our Mission</a></li>
<li><a href="#">Our Vision</a></li>
</ul>
</li>
</ul>
</AnonymousTemplate>
<LoggedInTemplate>
<ul class="nav navbar-nav">
<li><a href="CustomerPage.aspx">My profile</a></li>
<li><a href="AdvancedBooking.aspx" >Advanced Booking</a></li>
<li><a href="#">Transaction History</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">About us<i class="fa fa-angle-down"></i></a>
<ul class="dropdown-menu">
<li><a href="Secure/Default.aspx">Our Customers</a></li>
<li><a href="#">Our Truckers</a></li>
<li><a href="#">Our Mission</a></li>
<li><a href="#">Our Vision</a></li>
</ul>
</li>
<li><asp:LoginStatus runat="server" /></li>
</ul>
</LoggedInTemplate>
</asp:LoginView>
</div>
</div>
</nav>
&#13;
答案 0 :(得分:0)
尝试在另一个下拉菜单中使用唯一名称,并将其他数据切换链接到它,如下所示:
<AnonymousTemplate>
<ul class="nav navbar-nav">
<li><a href="Default.aspx">Home</a></li>
<li><a href="HowItWorks.aspx" >How it works?</a></li>
<li><a href="ContactUs.aspx">Contact us</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">About us <i class="fa fa-angle-down"></i></a>
<ul class="dropdown-menu">
<li><a href="Secure/Default.aspx">Our Customers</a></li>
<li><a href="#">Our Truckers</a></li>
<li><a href="#">Our Mission</a></li>
<li><a href="#">Our Vision</a></li>
</ul>
</li>
</ul>
</AnonymousTemplate>
<LoggedInTemplate>
<ul class="nav navbar-nav">
<li><a href="CustomerPage.aspx">My profile</a></li>
<li><a href="AdvancedBooking.aspx" >Advanced Booking</a></li>
<li><a href="#">Transaction History</a></li>
<li class="dropdown2">
<a href="#" class="dropdown-toggle" data-toggle="dropdown2">About us<i class="fa fa-angle-down"></i></a>
<ul class="dropdown-menu">
<li><a href="Secure/Default.aspx">Our Customers</a></li>
<li><a href="#">Our Truckers</a></li>
<li><a href="#">Our Mission</a></li>
<li><a href="#">Our Vision</a></li>
</ul>
</li>
<li><asp:LoginStatus runat="server" /></li>
</ul>
</LoggedInTemplate>
答案 1 :(得分:0)
<script src="js/bootstrap.min.js" type="text/javascript"></script>
将其更改为
<script src="/js/bootstrap.min.js" type="text/javascript"></script>
必须添加&#34; /&#34;在开始时将它定位在根文件夹中,对不起,如果这是一个愚蠢的错误,我只在asp.net开始1个月,为任何将面临此问题的人发布此答案。
-RobM