How to avoid an asp:Multiview to load all the views
Posted
by GigaPr
on Stack Overflow
See other posts from Stack Overflow
or by GigaPr
Published on 2010-03-16T20:32:40Z
Indexed on
2010/03/16
21:11 UTC
Read the original article
Hit count: 375
Hi I have a multiview control on my page and a menu to create a tab control
<asp:Menu ID="tabMenu" Orientation="Horizontal" StaticMenuItemStyle-CssClass="tab"
StaticSelectedStyle-CssClass="selectedTab" CssClass="tabs" OnMenuItemClick="Menu1_MenuItemClick" runat="server">
</asp:Menu><asp:MultiView ID="multiViewTab" ActiveViewIndex="0" runat="server">
<asp:View ID="viewDetails" runat="server">
<uc:ViewDetails runat="server" ID="ucViewDetails" />
</asp:View>
<asp:View ID="viewJobs" runat="server">
<uc:ViewJob ID="ucViewJob" runat="server" />
</asp:View>
<asp:View ID="viewJobList" runat="server">
<uc:ViewJobList ID="ucViewJobList" runat="server" />
</asp:View>
</asp:MultiView>
and i set the current view as follow
protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
int index = Int32.Parse(e.Item.Value);
if (index != 0)
{
tabMenu.FindItem("0").Selected = false;
}
multiViewTab.ActiveViewIndex = index;
}
it works well ... the only problem is that each time i click on a view all the views are loaded.while i would like to load only the one which is active
Do you know any way to avoid the loading of all the views?
© Stack Overflow or respective owner