一旦用户单击选项卡标题,我将在母版页中使用 jquery 选项卡打开 aspx 文件。但是,如果我使用我的页面作为链接,它将重复“标题”部分(类似于:jquery tabs and asp.net master pages issue)。已经尝试过解决方案,但无法理解它。有人可以帮忙吗。这是我在母版页中的代码:
<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>