asp.net選項卡的實現

來源:互聯網
上載者:User

添加一個控制項Menu再添加一個在標準控制項中。

設計:

源:

 

Code:
  1. <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" Width="501px" StaticEnableDefaultPopOutImage="False"  
  2.   
  3.            onmenuitemclick="Menu1_MenuItemClick" BackColor="White"    
  4.   
  5.            DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="14pt"    
  6.   
  7.            ForeColor="#7C6F57" StaticSubMenuIndent="10px" Font-Bold="True">   
  8.   
  9.            <StaticSelectedStyle BackColor="Silver" ForeColor="White" />   
  10.   
  11.            <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />   
  12.   
  13.            <DynamicHoverStyle BackColor="#FF9900" ForeColor="White" />   
  14.   
  15.            <DynamicSelectedStyle BackColor="#CC9900" />   
  16.   
  17.            <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />   
  18.   
  19.            <StaticHoverStyle BackColor="#99CCFF" ForeColor="White" />   
  20.   
  21.            <Items>   
  22.   
  23.                <asp:MenuItem Value="0" Text="基本資料" Selected="True"></asp:MenuItem>   
  24.   
  25.                <asp:MenuItem Value="1" Text="連絡方式"></asp:MenuItem>   
  26.   
  27.                <asp:MenuItem Value="2" Text="交友資料"></asp:MenuItem>   
  28.   
  29.                <asp:MenuItem Value="3" Text="興趣愛好"></asp:MenuItem>   
  30.   
  31.                <asp:MenuItem Value="4" Text="自我介紹"></asp:MenuItem>   
  32.   
  33.            </Items>   
  34.   
  35.   </asp:Menu>   

設計:

 

源:

Code:
  1. <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">   
  2.   
  3.     <asp:View ID="BasicInfo" runat="server">   
  4.   
  5.         <table style="width: 100%;">   
  6.   
  7.             <tr>   
  8.   
  9.             <td>   
  10.   
  11.             tab2   
  12.   
  13.             </td>   
  14.   
  15.             </tr>   
  16.   
  17.         </table>   
  18.   
  19.     </asp:View>   
  20.   
  21.     <asp:View ID="tab2" runat="server">   
  22.   
  23.     <table>   
  24.   
  25.     <tr>   
  26.   
  27.     <td>   
  28.   
  29.     tab2   
  30.   
  31.     </td>   
  32.   
  33.     </tr>   
  34.   
  35.     </table>   
  36.   
  37.     </asp:View>   
  38.   
  39.       <asp:View ID="View1" runat="server">   
  40.   
  41.     <table>   
  42.   
  43.     <tr>   
  44.   
  45.     <td>   
  46.   
  47.     tab3   
  48.   
  49.     </td>   
  50.   
  51.     </tr>   
  52.   
  53.     </table>   
  54.   
  55.     </asp:View>   
  56.   
  57.       <asp:View ID="View2" runat="server">   
  58.   
  59.     <table>   
  60.   
  61.     <tr>   
  62.   
  63.     <td>   
  64.   
  65.     tab4   
  66.   
  67.     </td>   
  68.   
  69.     </tr>   
  70.   
  71.     </table>   
  72.   
  73.     </asp:View>   
  74.   
  75.       <asp:View ID="View3" runat="server">   
  76.   
  77.     <table>   
  78.   
  79.     <tr>   
  80.   
  81.     <td>   
  82.   
  83.     tab5   
  84.   
  85.     </td>   
  86.   
  87.     </tr>   
  88.   
  89.     </table>   
  90.   
  91.     </asp:View>   
  92.   
  93.     </asp:MultiView>   

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.