Wizard.MoveTo Method
.NET Framework 3.0
Sets the specified WizardStepBase-derived object as the value for the ActiveStep property of the Wizard control.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
'Declaration Public Sub MoveTo ( _ wizardStep As WizardStepBase _ ) 'Usage Dim instance As Wizard Dim wizardStep As WizardStepBase instance.MoveTo(wizardStep)
public void MoveTo ( WizardStepBase wizardStep )
public function MoveTo ( wizardStep : WizardStepBase )
Not applicable.
Parameters
- wizardStep
The WizardStepBase-derived object to set as the ActiveStep.
| Exception type | Condition |
|---|---|
| The value of the WizardStepBase-derived object passed in is a null reference (Nothing in Visual Basic). | |
| The ActiveStepIndex of the associated WizardStepBase-derived object passed in is equal to -1. |
The following code example demonstrates how to use the MoveTo method to control the ActiveStep property of the Wizard control. If the value of CheckBox1.Checked is true, the ActiveStep property is set to Wizard1.Step3; otherwise, the ActiveStep property is set to Wizard1.Step2.
<%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Sub OnActiveStepChanged(ByVal sender As Object, ByVal e As EventArgs) ' If the ActiveStep is changing to Step2, check to see whether the ' CheckBox1 check box is selected. If it is, skip to the Step3 step. If Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(Me.WizardStep2) Then If (Me.CheckBox1.Checked) Then Wizard1.MoveTo(Me.WizardStep3) Else Wizard1.MoveTo(Me.WizardStep2) End If End If End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>ASP.NET Example</title> </head> <body> <form id="form1" runat="server"> <asp:Wizard id="Wizard1" runat="server" onactivestepchanged="OnActiveStepChanged"> <WizardSteps> <asp:WizardStep id="WizardStep1" title="Step 1" runat="server"> <asp:CheckBox id="CheckBox1" runat="Server" text="Select this check box to skip Step 2." /> You are currently on Step 1. </asp:WizardStep> <asp:WizardStep id="WizardStep2" title="Step 2" runat="server"> You are currently on Step 2. </asp:WizardStep> <asp:WizardStep id="WizardStep3" runat="server" title="Step 3"> You are currently on Step 3. </asp:WizardStep> </WizardSteps> <HeaderTemplate> <b>MoveTo Example</b> </HeaderTemplate> </asp:Wizard> </form> </body> </html>
Community Additions
ADD
Show: