gpt4 book ai didi

jquery - ASP.NET - Bootstrap 下拉导航仅在根页面上工作

转载 作者:行者123 更新时间:2023-11-28 09:44:58 25 4
gpt4 key购买 nike

我目前正在使用 Yeti Bootstrap 主题开发一个使用 ASP.NET 4.0 的内部应用程序。

我的导航栏下拉导航有问题。存储在网站根目录中的页面能够毫无问题地使用下拉功能。第一级下拉菜单是单击鼠标,但对于下拉菜单,当光标悬停在选择上时,会出现“界面作业”中管理选择的分支。

我遇到的问题是,当我在下拉列表中导航到一个页面,然后尝试在该页面上使用下拉导航时,下拉菜单将不起作用。我只能导航到日志查看器页面。

有没有人知道问题可能是什么?在此先感谢您的帮助!

母版页代码:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="BootStrapMasterPage.master.cs" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>ILG Interfaces</title>`
<link href="~/Content/css/bootstrap.css" rel="stylesheet" />
<link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript" src="Scripts/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="Scripts/bootstrap.min.js"></script>


<asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder>
</head>
<body>
<form id="Form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div class="navbar navbar-inverse">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">ILG Interfaces | <asp:LoginName ID="LoginName1" FormatString="Logged in as {0}" runat="server" /></a>
</div>
<div class="navbar-collapse collapse navbar-responsive-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown"><a href="#" data-toggle="dropdown" data-target="#">Interface Files <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><asp:HyperLink ID="HyperLink10" NavigateUrl="~/InterfaceFiles/Statistics.aspx" runat="server">Statistics </asp:HyperLink></li>
<li><asp:HyperLink ID="HyperLink9" NavigateUrl="~/InterfaceFiles/OutstandingSignups.aspx" runat="server">Outstanding Signups </asp:HyperLink></li>
</ul>
</li>

<li><asp:HyperLink NavigateUrl="~/LogViewer.aspx" runat="server">Log Viewer </asp:HyperLink></li>




<li><a href="#" class="dropdown-toggle" data-toggle="dropdown">Interface Jobs <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Admin</a>
<ul class="dropdown-menu">
<li><asp:HyperLink ID="HyperLink1" NavigateUrl="~/InterfaceAdmin/GIValidation.aspx" runat="server">Generic Interface Validation </asp:HyperLink></li>
<li><asp:HyperLink ID="HyperLink2" NavigateUrl="~/InterfaceAdmin/GIValidation.aspx" runat="server">Generic Interface Validation Rules </asp:HyperLink></li>
<li><asp:HyperLink ID="HyperLink3" NavigateUrl="~/InterfaceAdmin/GIValidation.aspx" runat="server">Generic Interface Postcode Validation </asp:HyperLink></li>
<li><asp:HyperLink ID="HyperLink4" NavigateUrl="~/InterfaceAdmin/GIValidation.aspx" runat="server">Synoptik File Sequences </asp:HyperLink></li>
</ul>
</li>
<li><asp:HyperLink ID="HyperLink5" NavigateUrl="~/InterfaceJobs/Jobs.aspx" runat="server">Jobs </asp:HyperLink></li>
<li><asp:HyperLink ID="HyperLink6" NavigateUrl="~/InterfaceJobs/JobSteps.aspx" runat="server">Jobs Steps </asp:HyperLink></li>
<li><asp:HyperLink ID="HyperLink7" NavigateUrl="~/InterfaceJobs/JobQ.aspx" runat="server">Jobs </asp:HyperLink></li>
</ul>
</li>

<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Admin <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><asp:HyperLink ID="HyperLink8" NavigateUrl="~/Admin/Clients.aspx" runat="server">Maintain Clients </asp:HyperLink></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="container">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>
</div>


</form>
</body>
</html>

我认为可能是问题所在的 JQuery:
$().dropdown('切换')

  $(document).click(function () {
$(".dropdown").hide('slow');
});

$(".dropdown").click(function (e) {
e.stopPropagation();
});

最佳答案

确保在调用 bootstrap 之前调用 jquery

关于jquery - ASP.NET - Bootstrap 下拉导航仅在根页面上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25289022/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com