MultiView和view的用法

<asp:Menu ID="Menu1" runat="server" StaticEnableDefaultPopOutImage="false" Orientation="Horizontal" OnMenuItemClick="Menu1_MenuItemClick">
            <Items>
                <asp:MenuItem Text="AAAAA" Value="0"></asp:MenuItem>
                <asp:MenuItem Text="BBBBB" Value="1"></asp:MenuItem>
                <asp:MenuItem Text="XXXXX" Value="2"></asp:MenuItem>
            </Items>
        </asp:Menu>
       
        <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0" >
            <asp:View ID="View1" runat="server" >
            AAAAAAAAAAAAAAAAAAAAAA
            </asp:View>
            <asp:View ID="View2" runat="server">
            BBBBBBBBBBBBBBBBBB
            </asp:View>
            <asp:View ID="View3" runat="server">
            XXXXXXXXXXXXXXXX
            </asp:View>
        </asp:MultiView>

-----------------------页面代码

----------------------代码

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

搜了很多,感觉不是很好,自己写了一个简单易懂的。 

posted @ 2008-08-12 11:23  xumingming  阅读(1344)  评论(1编辑  收藏  举报