WizardStepCollection Class
Assembly: System.Web (in system.web.dll)
'Declaration Public NotInheritable Class WizardStepCollection Implements IList, ICollection, IEnumerable 'Usage Dim instance As WizardStepCollection
public final class WizardStepCollection implements IList, ICollection, IEnumerable
public final class WizardStepCollection implements IList, ICollection, IEnumerable
The WizardStepCollection class is used to store and manage a collection of WizardStepBase-derived objects in a control that acts as a wizard, such as the CreateUserWizard control or the Wizard control. For example, the Wizard control uses the WizardStepCollection class for its WizardSteps property.
There are multiple ways you can access the WizardStepBase-derived objects in the WizardStepCollection:
-
Use the Item property to directly access a WizardStepBase-derived object at a specific zero-based index.
-
Use the GetEnumerator method to create an enumerator that can be used to iterate through the collection.
-
Use the CopyTo method to copy the contents of the WizardStepCollection collection into an Array object.
| Topic | Location |
|---|---|
| Walkthrough: Creating a Basic ASP.NET Wizard Control | Building ASP .NET Web Applications in Visual Studio |
| Walkthrough: Advanced Use of the ASP.NET Wizard Control | Building ASP .NET Web Applications in Visual Studio |
The following example demonstrates how to populate the WizardStepCollection collection using declarative syntax.
<%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <body> <form id="form1" runat="server"> <asp:Wizard id="Wizard1" runat="server" > <WizardSteps> <asp:WizardStep id="Step1" runat="server" title="Step 1"> </asp:WizardStep> <asp:WizardStep id="Step2" runat="server" title="Step 2"> </asp:WizardStep> <asp:WizardStep id="Step3" runat="server" title="Step 3"> </asp:WizardStep> <asp:WizardStep id="Step4" runat="server" title="Step 4"> </asp:WizardStep> <asp:WizardStep id="Step5" runat="server" title="Step 5"> </asp:WizardStep> <asp:WizardStep id="Step6" runat="server" title="Step 6"> </asp:WizardStep> </WizardSteps> <HeaderTemplate> <b>WizardStepCollection Example</b> </HeaderTemplate> </asp:Wizard> </form> </body> </html>
The following example demonstrates how to programmatically populate a WizardStepCollection collection.
<%@ Page Language="VB" CodeFile="WizardStepCollection.vb" Inherits="WizardStepCollectionvb_aspx" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <body> <form id="Form1" runat="server"> <h3>WizardStepCollection Example</h3> <asp:PlaceHolder id="PlaceHolder1" runat="server" /> </form> </body> </html>
The following is the code-behind file for the Web page in the preceding example.
Partial Class WizardStepCollectionvb_aspx Inherits System.Web.UI.Page Public Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) ' Programmatically create a wizard control. Dim Wizard1 As Wizard = New Wizard() ' Create steps for the wizard control and insert them ' into the WizardStepCollection collection. For i As Integer = 0 To 5 Dim newStep As WizardStepBase = New WizardStep() newStep.ID = "Step" + (i + 1).ToString() newStep.Title = "Step " + (i + 1).ToString() Wizard1.WizardSteps.Add(newStep) Next ' Display the wizard control on the Web page. PlaceHolder1.Controls.Add(Wizard1) End Sub End Class
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.