我在主頁面使用jquery選項卡打開aspx文件,一旦用戶單擊選項卡標題。但是,如果我使用我的頁面作爲鏈接,它會重複「標題」部分(類似於:jquery tabs and asp.net master pages issue)。已經嘗試過這種解決方案,但無法擺脫困境。有人可以請幫助。這裏是我的母版代碼:Jquery製表符和css問題
<form id="form1" runat="server">
<div class="mainWrapper">
<div class="wrapper">
<div class="header">
<a href="" class="logo"></a>
<div class="topToolbar">
<span>Welcome <a href="/" class="logOut">Log Out</a></span>
</div>
</div>
<div class="container">
<div id="tabs">
<div class="tabsCenter">
<ul>
<li><a href="Myfirstpage.aspx">First</a></li>
<li><a href="SecondPage.aspx">Second</a></li>
</ul>
</div>
<div class="tabsBottom">
</div>
</div>
<asp:ContentPlaceHolder ID="BodyContent" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
<div class="push">
</div>
</div>
</form>
編輯:
這裏是我的第二個版本的代碼:
<body>
<form id="form1" runat="server">
<div class="mainWrapper">
<div class="wrapper">
<div class="header">
<a href="" class="logo"></a>
<div class="topToolbar">
<span>Welcome <a href="/" class="logOut">Log Out</a></span>
</div>
</div>
<div class="container">
<div id="tabs">
<div class="tabsCenter">
<ul>
<li><a href="Track.aspx" runat="server" id="Tab1">Track</a></li>
<li><a href="Downloads.aspx" runat="server" id="Tab2" >Downloads</a></li>
<%--<li><a href="~/ClaimsLogin/ClaimsLogin">My Claims</a></li>
<li><a href="~/FAQ/FAQs">FAQ's</a></li>
<li><a href="~/MyProfile/ViewDetail">My Profile</a></li>
<li><a href="~/MyMessage/Message">Contact</a></li>--%>
</ul>
<div id="TabContent">
<asp:ContentPlaceHolder ID="BodyContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="TabContent2">
<asp:ContentPlaceHolder ID="BodyContent2" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
<div class="tabsBottom">
</div>
</div>
</div>
</div>
<div class="push">
</div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('.tabs').tabs({
select: function (event, ui) {
var url = $.data(ui.tab, 'load.tabs');
location.href = url; // follow url
return false; // to disable default handling
}
});
});
</script>
</body>
</html>
,並在頁面我這樣做:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Track.aspx.cs" Inherits="CustomerPortalV2.Track" MasterPageFile="~/Site.Master" %>
<asp:Content ID="Trackcontent" ContentPlaceHolderID="BodyContent" runat="server">
<div class="sideTabsWrapper">
Track page
</div>
</asp:Content>
任何人都可以幫忙嗎? – Zaki