Freigeben über


Wizard Web Server Control Declarative Syntax 

Provides navigation and a user interface (UI) to collect related data across multiple steps.

<asp:Wizard
    AccessKey="string"
    ActiveStepIndex="integer"
    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
        Inset|Outset"
    BorderWidth="size"
    CancelButtonImageUrl="uri"
    CancelButtonText="string"
    CancelButtonType="Button|Image|Link"
    CancelDestinationPageUrl="uri"
    CellPadding="integer"
    CellSpacing="integer"
    CssClass="string"
    DisplayCancelButton="True|False"
    DisplaySideBar="True|False"
    Enabled="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    FinishCompleteButtonImageUrl="uri"
    FinishCompleteButtonText="string"
    FinishCompleteButtonType="Button|Image|Link"
    FinishDestinationPageUrl="uri"
    FinishPreviousButtonImageUrl="uri"
    FinishPreviousButtonText="string"
    FinishPreviousButtonType="Button|Image|Link"
    Font-Bold="True|False"
    Font-Italic="True|False"
    Font-Names="string"
    Font-Overline="True|False"
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|
        Large|X-Large|XX-Large"
    Font-Strikeout="True|False"
    Font-Underline="True|False"
    ForeColor="color name|#dddddd"
    HeaderText="string"
    Height="size"
    ID="string"
    OnActiveStepChanged="ActiveStepChanged event handler"
    OnCancelButtonClick="CancelButtonClick event handler"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnFinishButtonClick="FinishButtonClick event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnNextButtonClick="NextButtonClick event handler"
    OnPreRender="PreRender event handler"
    OnPreviousButtonClick="PreviousButtonClick event handler"
    OnSideBarButtonClick="SideBarButtonClick event handler"
    OnUnload="Unload event handler"
    runat="server"
    SkinID="string"
    SkipLinkText="string"
    StartNextButtonImageUrl="uri"
    StartNextButtonText="string"
    StartNextButtonType="Button|Image|Link"
    StepNextButtonImageUrl="uri"
    StepNextButtonText="string"
    StepNextButtonType="Button|Image|Link"
    StepPreviousButtonImageUrl="uri"
    StepPreviousButtonText="string"
    StepPreviousButtonType="Button|Image|Link"
    Style="string"
    TabIndex="integer"
    ToolTip="string"
    Visible="True|False"
    Width="size"
>
        <CancelButtonStyle />
        <FinishCompleteButtonStyle />
        <FinishNavigationTemplate>
            <!-- child controls -->
        </FinishNavigationTemplate>
        <FinishPreviousButtonStyle />
        <HeaderStyle />
        <HeaderTemplate>
            <!-- child controls -->
        </HeaderTemplate>
        <NavigationButtonStyle />
        <NavigationStyle />
        <SideBarButtonStyle />
        <SideBarStyle />
        <SideBarTemplate>
            <!-- child controls -->
        </SideBarTemplate>
        <StartNavigationTemplate>
            <!-- child controls -->
        </StartNavigationTemplate>
        <StartNextButtonStyle />
        <StepNavigationTemplate>
            <!-- child controls -->
        </StepNavigationTemplate>
        <StepNextButtonStyle />
        <StepPreviousButtonStyle />
        <StepStyle />
        <WizardSteps>
                <asp:TemplatedWizardStep
                    AllowReturn="True|False"
                    ContentTemplateContainer="string"
                    EnableTheming="True|False"
                    EnableViewState="True|False"
                    ID="string"
                    OnActivate="Activate event handler"
                    OnDataBinding="DataBinding event handler"
                    OnDeactivate="Deactivate event handler"
                    OnDisposed="Disposed event handler"
                    OnInit="Init event handler"
                    OnLoad="Load event handler"
                    OnPreRender="PreRender event handler"
                    OnUnload="Unload event handler"
                    runat="server"
                    SkinID="string"
                    StepType="Auto|Complete|Finish|Start|Step"
                    Title="string"
                    Visible="True|False"
>
                        <ContentTemplate>
                            <!-- child controls -->
                        </ContentTemplate>
                        <CustomNavigationTemplate>
                            <!-- child controls -->
                        </CustomNavigationTemplate>
                </asp:TemplatedWizardStep>
                <asp:WizardStep
                    AllowReturn="True|False"
                    EnableTheming="True|False"
                    EnableViewState="True|False"
                    ID="string"
                    OnActivate="Activate event handler"
                    OnDataBinding="DataBinding event handler"
                    OnDeactivate="Deactivate event handler"
                    OnDisposed="Disposed event handler"
                    OnInit="Init event handler"
                    OnLoad="Load event handler"
                    OnPreRender="PreRender event handler"
                    OnUnload="Unload event handler"
                    runat="server"
                    SkinID="string"
                    StepType="Auto|Complete|Finish|Start|Step"
                    Title="string"
                    Visible="True|False"
                />
        </WizardSteps>
</asp:Wizard>

Remarks

You can use the Wizard control to complete the following tasks:

  • Collect related data across multiple steps.

  • Break up a larger Web page that is used to collect user input into smaller logical steps.

  • Allow for either linear or nonlinear navigation through the steps.

The Wizard control is made up of the following components:

  • A WizardStepCollection collection of steps that contains the user interface for each step, as defined by the page developer.

  • Built-in navigation capabilities that determine the appropriate buttons to display based on the StepType value.

  • A header area that can be customized to display information that is specific to the step that the user is currently on.

  • A sidebar area that can be used to quickly navigate to steps in the control.

For more information on the Wizard control, see Wizard Web Server Control.

Example

The following code example demonstrates how to define a Wizard control declaratively. The wizard has two steps and the StartNavigationTemplate and FinishNavigationTemplate property templates are defined.

<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="1">
  <WizardSteps>
  <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
  </asp:WizardStep>
  <asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
  </asp:WizardStep>
  </WizardSteps>
  <StartNavigationTemplate>
  <asp:Button ID="StartNextButton" runat="server" CommandName="MoveNext" Text="Next" />
  </StartNavigationTemplate>
  <FinishNavigationTemplate>
  <asp:Button ID="FinishPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
    Text="Previous" />
  <asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete" Text="Finish" />
  </FinishNavigationTemplate>
</asp:Wizard>
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="1">
  <WizardSteps>
  <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
  </asp:WizardStep>
  <asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
  </asp:WizardStep>
  </WizardSteps>
  <StartNavigationTemplate>
  <asp:Button ID="StartNextButton" runat="server" CommandName="MoveNext" Text="Next" />
  </StartNavigationTemplate>
  <FinishNavigationTemplate>
  <asp:Button ID="FinishPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
    Text="Previous" />
  <asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete" Text="Finish" />
  </FinishNavigationTemplate>
</asp:Wizard>

See Also

Reference

Wizard

Other Resources

Wizard Web Server Control