如何在选择ASP.Net母版页中的特定jquery选项卡时进行回发?
请帮忙。任何答案将不胜感激。感谢
这是我的标记。顺便说一句,我只是从默认情况下复制了一些代码,老实说,因为我是ASP.Net中的新手。我只是想尝试一些代码和设计,并想了解更多相关信息。
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="SiteMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script type="text/javascript">
$(function () {
$("#tabs").tabs();
});
</script>
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<div class="page">
<div class="header">
<div class="title">
<h1>
My ASP.NET Application
</h1>
</div>
<div class="loginDisplay">
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
<AnonymousTemplate>
[ <a href="~/Account/Login.aspx" id="HeadLoginStatus" runat="server">Log In</a>
]
</AnonymousTemplate>
<LoggedInTemplate>
Welcome <span class="bold">
<asp:LoginName ID="HeadLoginName" runat="server" />
</span>! [
<asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out"
LogoutPageUrl="~/" />
]
</LoggedInTemplate>
</asp:LoginView>
</div>
</div>
<div id="tabs" runat="server">
<ul>
<li><a href="Book.aspx" runat="server" id="Tab1">Book</a></li>
<li><a href="Default.aspx" runat="server" id="Tab2">Authors</a></li>
<li><a href="New.aspx" runat="server" id="Tab3">New</a></li>
<li><a href="About.aspx" runat="server" id="Tab4">About</a></li>
</ul>
<div id="TabContent" class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
</div>
</div>
<div class="clear">
</div>
</div>
<div class="footer">
</div>
</form>
</body>
</html>
每当我点击任何标签时,它都不会回发,而是内容及其地址栏始终保留我设置为起始页面的任何页面。
答案 0 :(得分:0)
试试此代码
$("#tab").on('click',function(){
__doPostBack('tab','');
});