This tutorial will show you how to use the MultiView Control in conjunction with AJAX to create multi-step applications. VB.NET.
In this tutorial, we will discuss the ASP.NET MultiView Control using VB.NET. This control is a way for developers to avoid making several aspx files for a long process such as a detailed form. We will be creating a form with several views without changing pages utilizing the AJAX controls.

First you can start a new Web Application in Visual Studio 2008. To allow the MultiView control to load each view without reloading the page, we will need to place it inside of the

Now we can add the MultiView control from the toolbox. This will add the tag to the application in between the tags. The ActiveViewIndex is an attribute that tells the server which view to display first. Now we will add multiple views by using the tags. Inside of each tag is where you will place the contents of each “page.”

In our example, our first view will consist of text directing the using to click the continue button. The continue button is located outside of the MultiView so it appears to be on every view. The next page will have a TextBox where the user will be directed to enter their name. Finally, the last page will display the name they entered or alert the user that no name was entered.

Now we need to program the VB.NET behind the page for the MultiView form to function properly. In design view you can double-click the continue button or add the click event sub as showed below.

The beginning IF statement determines which current view the visitor is on. The next view is displayed with the SetActiveView method from the MultiView object. The second IF statement displays the name or alerts the user that a name wasn’t entered in the tag located in View3. Once the continue button has been clicked on the last page, the visitor is redirected to View1 to start the process all over again.

The MultiView controls can be used outside of the AJAX components but will force the page to reload to display a new view.

Download Source Files