【发布时间】:2014-11-27 08:08:00
【问题描述】:
当我单击选项卡配置文件然后将(配置文件的)li 类从无更改为“活动”时,我无法将(家庭的)li 类从“活动”更改为无(或其他类)当配置文件被激活时。
这是我的代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<asp:PlaceHolder runat="server">
<%-- Style Section --%>
<%: Styles.Render("~/bundles/Css") %>
</asp:PlaceHolder>
<script type="text/javascript">
function openHome() {
location.href = "Home.aspx";
}
function openProfile() {
location.href = "Profile.aspx";
}
</script>
<asp:ContentPlaceHolder ID="StyleSection" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<br />
<div class="container">
<div class="jumbotron">
<h1>
BANNER</h1>
</div>
</div>
<!-- MENU START -->
<ul class="nav nav-tabs">
<li class="active"><a href="#home" data-toggle="tab" onclick="openHome();">Home</a></li>
<li><a href="#profile" data-toggle="tab" onclick="openProfile();">Profile</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="home">
</div>
<div class="tab-pane fade" id="profile">
</div>
</div>
<%-- Script Section --%>
<%: Scripts.Render("~/bundles/jQuery") %>
<asp:ContentPlaceHolder ID="ContentSection" runat="server">
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="ScriptSection" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
有人可以帮帮我吗?我尝试了在 stackoverflow 找到的类似解决方案,但无法完成工作。非常感谢。
【问题讨论】:
-
你能把你的jquery代码放在这里吗。
-
不是asp-classic。
-
其实这个原始页面是一个.aspx页面。但是当我发布时,我删除了 asp 内容,因为我认为它与我的问题无关。
标签: javascript c# jquery css asp.net