⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.aspx

📁 .net平台下
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AdvControls" Namespace="AdvControls" TagPrefix="cc1" %>
<!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>TabControl test page</title>
    <script type="text/javascript" language="javascript">
    function ShowTab(tabTitleCell, idx)
    {    
        //get the table which holds the tabs
        var tabsTable = tabTitleCell.parentElement.parentElement.parentElement;
        
        //what is the active tab index
        var activeTabIdx = Number(tabsTable.getAttribute("ActiveTabIdx"));
        
        //give the inactive appearance to the previous active tab
        tabsTable.rows[0].cells[activeTabIdx].style["backgroundColor"] = "inactiveborder";
        tabsTable.rows[0].cells[idx].style["backgroundColor"] = "darkgray";
        
        //since the tabs body contained in rows with index as the same of the tab title link plus 1,
        //then we can hide the row that holds the active tab.
        tabsTable.rows[activeTabIdx + 1].style.display = "none";
        
        //show the active tab body
        tabsTable.rows[idx + 1].style.display = "";
        
        //keep the new active tab in the attribute ActiveTabIdx
        tabsTable.setAttribute("ActiveTabIdx", idx);
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <cc1:MyTabControl ID="MyTabControl1" runat="server" Height="165px" Width="282px" SelectedTab="1">
                <TabPages>
                    <cc1:MyTabPage ID="MyTabPage1" runat="server" Title="Tab 1">
                        <TabBody>
                            <asp:Label ID="Label1" runat="server" Text="Tab 1 Body"></asp:Label>
                        </TabBody>
                    </cc1:MyTabPage>
                    <cc1:MyTabPage ID="MyTabPage2" runat="server" Title="Tab 2">
                        <TabBody>
                            <asp:Label ID="Label1" runat="server" Text="Tab 2 Body"></asp:Label>
                        </TabBody>
                    </cc1:MyTabPage>
                    <cc1:MyTabPage ID="MyTabPage3" runat="server" Title="Tab 3">
                        <TabBody>
                            <asp:Label ID="Label1" runat="server" Text="Tab 3 Body"></asp:Label>
                        </TabBody>
                    </cc1:MyTabPage>
                </TabPages>
            </cc1:MyTabControl>
        </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -