ASP.Net 2.0 C# 选项卡效果

页面代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Htgl_DataAdmin_Default" %>

<!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>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
    <asp:Menu ID ="Menu1" Width="168px" runat ="server" Orientation="horizontal" StaticEnableDefaultPopOutImage="false" OnMenuItemClick ="Menu1_MenuItemClick">
    <Items >
    <asp:MenuItem Text ="Tab1" Value ="0"></asp:MenuItem>
    <asp:MenuItem   Text ="Tab2" Value ="1"></asp:MenuItem>
    <asp:MenuItem   Text ="Tab3" Value ="2"></asp:MenuItem>
    </Items>
    </asp:Menu>
    <asp:MultiView ID ="MultiView1" runat ="server" ActiveViewIndex ="0">
    <asp:View ID ="Tab1" runat ="server" >
    <table style ="width :600px; height:400px;" cellpadding ="0" cellspacing ="0">
    <tr valign ="top">
    <td class ="TabArea" style ="width:600px">
    TAB VIEW 4
INSERT YOUR CONENT IN HERE
CHANGE SELECTED IMAGE URL AS NECESSARY
    </td>
    </tr>
    </table>
    </asp:View>
    <asp:View ID ="Tab2" runat ="server" >
    <table style ="width :600px; height :400px;" cellpadding ="0" cellspacing ="0">
    <tr valign ="top" >
    <td class ="TabArea" style ="width :600px">
    TAB VIEW 2
INSERT YOUR CONENT IN HERE
CHANGE SELECTED IMAGE URL AS NECESSARY
    </td>
    </tr>
    </table>
    </asp:View>
    <asp:View ID ="Tab3" runat="server" >
    <table style =" width:600px; height :400px" cellpadding ="0" cellspacing ="0">
    <tr valign ="top">
    <td class ="TabArea" style ="width :600px">
        TAB VIEW 54INSERT YOUR CONENT IN HERE
CHANGE SELECTED IMAGE URL AS NECESSAR
    </td>
    </tr>
    </table>
    </asp:View>
    </asp:MultiView>
    </div>
    </form>
</body>
</html>

C#代码:

protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
    {
        MultiView1.ActiveViewIndex = Convert.ToInt32(Menu1.SelectedValue);
      

    }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值