The MultiView and View server controls work together to enable
the capability to turn on/off sections of an ASP.NET page. As an
example, add the MultiView control with 3 View
controls and add some controls to these Views. Add also a button
which will allow to display the next view:
<asp:MultiView
ID="MultiView1"
runat="server">
<asp:View
ID="View1"
runat="server">
<asp:Image
ID="Image1"
runat="server"
ImageUrl="Images/1st.jpg"
/>
</asp:View>
<asp:View
ID="View2"
runat="server">
<asp:Image
ID="Image2"
runat="server"
ImageUrl="Images/2nd.jpg"
/>
</asp:View>
<asp:View
ID="View3"
runat="server">
<asp:Image
ID="Image3"
runat="server"
ImageUrl="Images/3rd.jpg"
/>
</asp:View>
</asp:MultiView>
<asp:Button
ID="Button3"
runat="server"
Text="Next
view >>"
onclick="Button3_Click"
/>
protected
void
Page_Load(object
sender, EventArgs
e)
{
if
(!IsPostBack)
{
MultiView1.ActiveViewIndex =
0;
}
}
protected
void
Button3_Click(object
sender, EventArgs
e)
{
if
(MultiView1.ActiveViewIndex < MultiView1.Views.Count - 1)
{
MultiView1.ActiveViewIndex++;
}
}