62,046
社区成员
发帖
与我相关
我的任务
分享
<!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 id="Head1" runat="server">
<title>Tab选项卡</title>
<link rel="stylesheet" type="text/css" href="css/mflStyle.css" />
</head>
<script>
function CallTheServer(arg,context) {
<%= callBackReference %>
}
function setTab(n)
{
for(i=1;i<=6;i++)
{
var menu=document.getElementById("two"+i);
var con=document.getElementById("zjj_two_"+i);
menu.className=i==n?"hover":"";
con.style.display=i==n?"block":"none";
}
}
</script>
<body>
<form id="form1" runat="server">
<td style="left: 101px; position: absolute; top: 350px; width: 801px;">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div id="Tab2" style="width: 800px; height: 123px;">
<div class="Menubox" style="height: 1px">
<ul class="topborder" style="width: 799px; height: 1px; top: 1px; left: 0px;">
<li id="two1" onclick="CallTheServer('1','')" style="width: 90px">Tab1</li>
<li id="two2" onclick="CallTheServer('2','')" style="width: 94px">Tab2</li>
<li id="two3" onclick="CallTheServer('3','')" style="width: 81px">Tab3</li>
<li id="two4" onclick="CallTheServer('4','')" style="width: 82px">Tab4</li>
<li id="two5" onclick="CallTheServer('5','')" style="width: 81px">Tab5</li>
<li id="two6" onclick="CallTheServer('6','')" style="width: 79px">Tab6</li>
</ul>
</div>
<div id="DIV1" class="Contentbox" style="width: 799px; height: 31px;">
<div id="zjj_two_1" style="text-align: left">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div id="zjj_two_2" style="display: none; text-align: left">
2</div>
<div id="zjj_two_3" style="display: none; text-align: left">
3</div>
<div id="zjj_two_4" style="display: none; text-align: left;">
4</div>
<div id="zjj_two_5" style="display: none; text-align: left;">
5</div>
<div id="zjj_two_6" style="display: none; text-align: left;">
6</div>
</div>
</div>
</td>
</form>
</body>
public partial class index : System.Web.UI.Page,ICallbackEventHandler
{
public string callBackReference;
private string num;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.callBackReference = this.Page.ClientScript.GetCallbackEventReference(this, "arg", "setTab", "context");
}
}
public string GetCallbackResult()
{
return this.num;
}
public void RaiseCallbackEvent(string eventArgument)
{
if (string.IsNullOrEmpty(eventArgument))
{
this.num = "0";
}
else
{
//这里根据值写绑定事件,但是没有用.
this.num = eventArgument;
}
}
}
<head id="Head1" runat="server">
<title>Tab选项卡</title>
<script language="javascript" type="text/javascript">
function showGridView(GVNum) {
innerGridView.location = "GridViewPage.aspx?flag=" + GVNum;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<table width="100%"><tr>
<td >
<span id = "two1" style="width:120px; cursor:hand; background-color:#eeeeee" onclick="showGridView(1)" >Tab1</span>
<span id = "two2" style="width:120px; cursor:hand; background-color:#eeeeee" onclick="showGridView(2)" >Tab2</span>
<span id = "two3" style="width:120px; cursor:hand; background-color:#eeeeee" onclick="showGridView(3)">Tab3</span>
<span id = "two4" style="width:120px; cursor:hand; background-color:#eeeeee" onclick="showGridView(4)" >Tab4</span>
<span id = "two5" style="width:120px; cursor:hand; background-color:#eeeeee" onclick="showGridView(5)" >Tab5</span>
<span id = "two6" style="width:120px; cursor:hand; background-color:#eeeeee" onclick="showGridView(6)" >Tab6</span>
</td>
</tr>
<tr><td>
<iframe id = "innerGridView" width="100%" height="300px"></iframe>
</td></tr>
</table>
</form>
</body>