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);
}
搜了很多,感觉不是很好,自己写了一个简单易懂的。