如题所述
第1个回答 2012-06-20
<asp:Menu ID="TabBar" runat="server" Orientation="Horizontal" OnMenuItemClick="Menu1_MenuItemClick"
Font-Size="12px" CssClass="tb-tabbar" BorderStyle="Solid" Height="20" BorderWidth="1"><Items>
<asp:MenuItem Text="1" Value="0" Selected="True"></asp:MenuItem>
<asp:MenuItem Text="2" Value="1"></asp:MenuItem>
<asp:MenuItem Text="3 Value="2"></asp:MenuItem>
</Items>
</asp:Menu>
这里的value就是索引,是为了在<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0"> <asp:View ID="View1" runat="server">中识别用的
通过后台修改index
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MultiView1.ActiveViewIndex = Convert.ToInt32(TabBar.SelectedValue);
}
Font-Size="12px" CssClass="tb-tabbar" BorderStyle="Solid" Height="20" BorderWidth="1"><Items>
<asp:MenuItem Text="1" Value="0" Selected="True"></asp:MenuItem>
<asp:MenuItem Text="2" Value="1"></asp:MenuItem>
<asp:MenuItem Text="3 Value="2"></asp:MenuItem>
</Items>
</asp:Menu>
这里的value就是索引,是为了在<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0"> <asp:View ID="View1" runat="server">中识别用的
通过后台修改index
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MultiView1.ActiveViewIndex = Convert.ToInt32(TabBar.SelectedValue);
}