You will now create a completion step that acts as the end point of your wizard. The Complete step has no navigational options.
To add a completion step
Right-click the Wizard control.
Choose Show Smart Tag.
In the Wizard Tasks dialog box, choose Add/Remove Wizard Steps.
The WizardStep Collection Editor appears.
From the Add drop-down list on the Add button, select Wizard Step.
The Properties area now shows the new step.
Set the Title property to Finished.
Set the StepType property to Complete.
Click OK.
Now you can edit your new completion step. For the purposes of this walkthrough, configure the completion step to show the data the user entered on the previous steps.
To edit the completion step
Right-click the Wizard control and choose Show Smart Tag.
In the Wizard Tasks dialog box, use the Step drop-down list to choose the Finished step.
Note: |
|---|
The name in the drop-down list will be the name you gave the step when you created it,
Finished in this example.
|
Drag a Label control onto the wizard, leaving the default name of Label1.
Drag another Label control onto the wizard, leaving the default name of Label2.
Save the file.
The completion step will display the data entered by the user. Use the page's Load event to assign the values from the first two steps to the labels you added to the completion step.
To show the user's data
Return to Default.aspx and, in Design view, double-click the design surface.
The page now contains a Page_Load method that is stubbed out for you.
Add the following highlighted code.
|
Private Sub Page_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles Me.Load
Label1.Text = TextBox1.Text
Label2.Text = TextBox2.Text
End Sub
|
|
void Page_Load(Object sender, System.EventArgs e)
{
Label1.Text = TextBox1.Text;
Label2.Text = TextBox2.Text;
}
|
Save the file.