Friday 30 June 2017

Tab in asp.net

Tab in asp.net

<asp:Menu ID="Menu1" Orientation="Horizontal" runat="server" OnMenuItemClick="Menu1_MenuItemClick">
            <Items>
                <asp:MenuItem Text="first tab" Value="0" Selected="true"></asp:MenuItem>
                <asp:MenuItem Text="second tab" Value="1"></asp:MenuItem>
            </Items>
        </asp:Menu>
        <asp:MultiView ID="MultiView1" ActiveViewIndex="0" runat="server">
            <asp:View ID="View1" runat="server">
                <div style="border: 1px solid black; width: 10%; height: 100px">
                    hello...
                </div>
            </asp:View>
            <asp:View ID="View2" runat="server">
                <div style="border: 1px solid black; width: 10%; height: 100px">
                    hye....
                </div>
            </asp:View>
</asp:MultiView>



protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
        {
            int index = Int32.Parse(e.Item.Value);
            MultiView1.ActiveViewIndex = index;
        }

No comments:

Post a Comment