Displaying a Wizard : Wizard « ASP.net Controls « ASP.NET Tutorial






ActiveStep:                 get the active WizardStep control.

ActiveStepIndex:            set or get the index of the active WizardStep control.

CancelDestinationPageUrl:   URL when clicking Cancel button.

DisplayCancelButton:        hide or display the Cancel button.

DisplaySideBar:             hide or display the Wizard control's sidebar. 

FinishDestinationPageUrl:   URL when clicking the Finish button.

HeaderText:                 header text that appears at the top of the Wizard control.

WizardSteps:                get the WizardStep controls.



The Wizard control supports the following templates:


FinishNavigationTemplate:    appearance of the navigation area of the finish step.

HeaderTemplate:              appearance of the header area.

SideBarTemplate:             appearance of the sidebar area.

StartNavigationTemplate:     appearance of the navigation area of the start step.

StepNavigationTemplate:      appearance of the navigation area of steps that are not start, finish, or complete steps.

The Wizard control also supports the following methods:

GetHistory():     return the collection of WizardStep controls that have been accessed.

GetStepType():    return the type of WizardStep at a particular index. 
                  Possible values are Auto, Complete, Finish, Start, and Step.

MoveTo():         move to a particular WizardStep.


The Wizard control also supports the following events:

ActiveStepChanged:        Called when a new WizardStep becomes the active step.

CancelButtonClick:        Called when the Cancel button is clicked.

FinishButtonClick:        Called when the Finish button is clicked.

NextButtonClick:          Called when the Next button is clicked.

PreviousButtonClick:      Called when the Previous button is clicked.

SideBarButtonClick:       Called when a sidebar button is clicked.

The WizardStep control supports the following properties:

AllowReturn:      prevent or allow a user to return to this step from a future step.

Name:             return the name of the WizardStep control.

StepType:         get or set the type of wizard step. 
                  Possible values are Auto, Complete, Finish, Start, and Step.

Title:            get or set the title of the WizardStep. 
                  The title is displayed in the wizard sidebar.

Wizard:           get the Wizard control containing the WizardStep.

The WizardStep also supports the following two events:

Activate:        Raised when a WizardStep becomes active.

Deactivate:      Raised when another WizardStep becomes active.

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        lblSSNResult.Text = txtSSN.Text;
        lblPhoneResult.Text = txtPhone.Text;
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Show Wizard</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <asp:Wizard
        id="Wizard1"
        HeaderText="Product Survey"
        OnFinishButtonClick="Wizard1_FinishButtonClick"
        CssClass="wizard"
        HeaderStyle-CssClass="header"
        SideBarStyle-CssClass="sideBar"
        StepStyle-CssClass="step"
        Runat="server">
        <WizardSteps>
        <asp:WizardStep ID="WizardStep1" Title="Introduction">
        Please complete our survey so that we can improve our
        products.
        </asp:WizardStep>
        <asp:WizardStep ID="WizardStep2" Title="Step 1">
        <asp:Label
            id="lblSSN"
            Text="Social Security Number:"
            AssociatedControlID="txtSSN"
            Runat="server" />
        <br />
        <asp:TextBox
            id="txtSSN"
            Runat="server" />
        </asp:WizardStep>
        <asp:WizardStep ID="WizardStep3" Title="Step 2" StepType="Finish">
        <asp:Label
            id="lblPhone"
            Text="Phone Number:"
            AssociatedControlID="txtPhone"
            Runat="server" />
        <br />
        <asp:TextBox
            id="txtPhone"
            Runat="server" />
        </asp:WizardStep>
        <asp:WizardStep ID="WizardStep4" Title="Summary" StepType="Complete">
        <h1>Summary</h1>
        Social Security Number:
        <asp:Label
            id="lblSSNResult"
            Runat="server" />
        <br /><br />
        Phone Number:
        <asp:Label
            id="lblPhoneResult"
            Runat="server" />
        </asp:WizardStep>
        </WizardSteps>
    </asp:Wizard>

    </div>
    </form>
</body>
</html>








3.29.Wizard
3.29.1.Displaying a Wizard
3.29.2.A simple Wizard control (C#)
3.29.3.A simple Wizard control (VB)
3.29.4.Wizard and its steps (C#)
3.29.5.WizardStep
3.29.6.Custom wizard navigation
3.29.7.Custom wizard
3.29.8.Help Example Wizard
3.29.9.Wizard template