Using the MultiView and View controls tutorials

Add a new Web Form to the project. Name it UseMultiview.aspx.

Add a MultiView control to this Web Form.

The main purpose of the MultiViewis to manage a set of Views. To
add a Viewto a MultiView, drag a View instance from the Toolbox
and drop it insidethe MultiView. Add three Views to the Web Form
like so. You might need to tweak the size of the container manually to get the
views to fit:

Add some content to each of the Views. You can think of the Views very
much like panes.In this example, the views include labels that distinguish
them. The following graphic illustrates how the Views look in the
Designer:

Activate the first pane. To cause the MultiView and the first View to show
up, set the MultiView ActiveViewIndex property to 0 to show the first pane.

Add some controls to navigate between the Views in MultiView by adding two
buttons to the bottom of the form. Call them ButtonPrev and ButtonNext—they’ll
be used to page through the Views.

Add event handlers for the buttons by double-clicking each of them.

Add code to the page through the Views. This code responds to the button
clicks by changing the index of the current View.

protected void ButtonPrev_Click(object sender, EventArgs e)

{

if (MultiView1.ActiveViewIndex == 0)

{

MultiView1.ActiveViewIndex = 2;

}

else

{

MultiView1.ActiveViewIndex -= 1;

}

}

protected void ButtonNext_Click(object sender, EventArgs e)

{

if (MultiView1.ActiveViewIndex == 2)

{

MultiView1.ActiveViewIndex = 0;

}

else

{

MultiView1.ActiveViewIndex += 1;

}

}

Compile the project and browse to the Web page. Clicking the navigator
buttons causes postbacks to the server, which render the individual views. The
following graphic shows how the MultiView and View number 2 appear in a
browser:

As you can see, the MultiView and the Viewclasses act as panes that
you can swap in and out. They are a great way to manage the surface area
involved in collecting large amounts of data. Another version of this kind of
control is the Wizard control used in conjunction with the session
state.

Thank you for visiting www.cbtSAM.com. This site is dream of Samir Patel, when most people dream when in sleep, my dream doesn't let me sleep. cbtSAM Web site is provided as a service and learning tool to the public. While the information contained within the site is periodically updated,no guarantee is given that the iormation provided in this Web site is correct, complete, and up-to-date. We are not responsible for... Read More .