<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Top.aspx.cs" Inherits="Admin_Top" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="../css/style_new.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../js/jquery.js" type="text/javascript></script>
<script type="text/javascript">
$(function () {
//頂部導航切換
$(".nav li a").click(function () {
$(".nav li a.selected").removeClass("selected")
$(this).addClass("selected");
})
})
}
</script>
</head>
<body style="background:url(../images/topbg.gif) repeat-x;">
<form id="form1" runat="server">
<div class="topleft">
<a href="main.html" target="_parent"><img src="../images/loginlogo.png" title="系統首頁" /></a>
</div>
<div class="topright">
<ul>
<li><a href="#"><asp:Label ID="Label1" runat="server"></asp:Label></a></li>
<li><a href="../Login.aspx" target="_parent"">退出</a></li>
</ul>
</div>
</form>
</body>
</html>
用document.location.replace('http://ask.csdn.net/questions/241212')來轉向,阻止默認的連接href跳轉
<a href="http://ask.csdn.net/questions/241212">http://ask.csdn.net/questions/241212</a><br>
<a href="http://ask.csdn.net/questions/240607">http://ask.csdn.net/questions/240607</a>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script>
<script>
$('a').click(function(){
document.location.replace(this.href);
return false;
});
</script>