我的母版页中有一个Jquery SooperFish菜单。点击任何重新加载菜单的SubMenu选项。有没有办法每次在子页面中重新加载菜单? 减少数据库查找。
编辑:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="elogis.master.cs" Inherits="elogis.elogis" %>
<!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">
<title></title>
<link rel="stylesheet" type="text/css" href="Styles/sooperfish.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="Styles/sooperfish-theme-large.css"
media="screen"/>
<script src="Jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="Jquery/jquery.easing-sooper.js" type="text/javascript"></script>
<script src="Jquery/jquery.sooperfish.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('ul.sf-menu').sooperfish();
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SooperFish spoorfishMenu = new SooperFish();
Literal1.Text = spoorfishMenu.ExecuteXSLTransformation();
}
}
答案 0 :(得分:0)
看起来好像是onClick回发,如果你自己编写(JS)add:
返回false;
最后 -
onClick="doSomething();return false;"
答案 1 :(得分:0)
除非您使用UpatePanel's
或其他AJAX
框架,否则每个post-back
都是新的HTTP请求,这意味着必须重新加载菜单,因为该网页已重新加载。
您有多种缓存选项,搜索SO或查看下面的链接以开始使用: