Use the MultiView control to dynamically switch views in a page : MultiView « ASP.net Controls « ASP.NET Tutorial






<%@ Page language="C#"%>

<script runat="server">
   void Page_Load(object sender, EventArgs e)
   {
       Tables.ActiveViewIndex = Views.SelectedIndex;
   }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>View controls</title>
</head>
<body>
    <div id="pageContent">
        <form id="Form1" runat="server">
            <tr>
            <td valign="top">
            <asp:DropDownList Runat="server" ID="Views" AutoPostBack="true">
                <asp:ListItem Value="Employees" /> 
                <asp:ListItem Value="Products" /> 
                <asp:ListItem Value="Customers" /> 
            </asp:DropDownList>
            </td>
            <td valign="top" style="border:solid 1px black;">
            <asp:MultiView runat="server" id="Tables" ActiveViewIndex="0" >
              <asp:View runat="server" id="Employees">
                    <h1>Employees</h1>
              </asp:View>
              <asp:View runat="server" id="Products">
                    <h1>Products</h1>
                </asp:View>
                <asp:View runat="server" id="Customers">
                    <h1>Customers</h1>
                </asp:View>
            </asp:MultiView>
            </td>
            </tr>
        </form>
    </div>
</body>
</html>








3.23.MultiView
3.23.1.MultiView hides and display different areas of a page, useful to create a tabbed page
3.23.2.What is an asp:MultiView (C#)
3.23.3.Displaying a Multi-Part Form
3.23.4.Use the MultiView control to dynamically switch views in a page
3.23.5.MultiView and View Controls
3.23.6.Active index