Asp.Net Multiview Control

The Multiview control of ASP.Net is an amazing control: it is versatile, user-frienldy and easy to use. If you want to see its use, look no further than this website itself. In fact, the tutorial set of the whole site is developed by using the Multiview control.

Inside the Multiview control, there are Views. You can use as many views as possible, with at least one navigation button at the bottom of each view so that the user can easily navigate from one view to another.

A typical Multiview control, say, with three views, looks as follows:



Asp.Net Multiview control

At the bottom of each view panel, navigation buttons must be placed so that the user can toggle between the views. They take the form of Next and Previous. Then, the Button_Click() event of the buttons and PPage_load() must be programmed so that this amazing control shows its amazing potential.

Page_Load() Event
public partial class aspnetmail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// The first view loads up, by default - ActiveViewIndex = 0
MultiView1.ActiveViewIndex = 0;
}
}

btnNext_Click() Event
protected void btnNext_Click(object sender, EventArgs e)
{
// Just increase the ActiveViewIndex by 1,
MultiView1.ActiveViewIndex += 1;
}
btnPrevious_Click() Event
protected void btnPrevious_Click(object sender, EventArgs e)
{
// Just just the ActiveViewIndex by 1,
MultiView1.ActiveViewIndex -= 1;
}

In the next two views, I am going to display the tune of a nursery rhyme and a video of the same, simply played by an acoustic guitar, respectively.