我有示例导航栏。但由于'数据切换'和'数据目标'不起作用,我无法崩溃。如果我的代码中有任何其他问题,请帮助我并提供建议。这是代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/css/bootstrap.min.css" />
<title>Basic Log In Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="Default.aspx" ><span><img alt="logo" src="Images/logo.png" height="30" /></span>BootStrap Demo</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="Default.aspx">Home</a></li>
<li><a href="#">About</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Social</a>
<ul class="dropdown-menu">
<li><a href="#">facebook</a></li>
<li><a href="#">Twitter</a></li>
<li><a href="#">Google+</a></li>
<li><a href="#">Instagram</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</form>
<script type="text/javascript" src="/js/bootstrap.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/jquery-1.12.0.min.js"></script>
</body>
</html>
答案 0 :(得分:2)
我在bootply创建了你的例子,它运行得很好。所以我现在可以看到的是你的bootstrap js可能没有加载。首先在bootstrap css之后将它添加到页面上方然后你应该没问题。在这里查看http://www.bootply.com/z2FXC4SKJn