Online Book Reader

Home Category

Programming Microsoft ASP.NET 4 - Dino Esposito [211]

By Root 5580 0

First step

Second step

Final step

The navigation bar consists of autogenerated buttons that provide any needed functionality—typically, going to the next or previous step or finishing. You can modify the look and feel of the navigation bar by using styles and templates.

The optional sidebar is used to display content on the left side of the control. It provides an overall view of the steps needed to accomplish the wizard’s task. By default, it displays a description of each step, with the current step displayed in boldface type. You can customize the sidebar using styles and templates. Figure 9-8 shows the default user interface. Each step is labeled using the ID of the corresponding tag.

Figure 9-8. A wizard with the default sidebar on the left side.

Wizard Styles and Templates


You can style all the various parts and buttons of a Wizard control by using the properties listed in Table 9-5.

Table 9-5. The Wizard Control’s Style Properties

Style

Description

CancelButtonStyle

Sets the style properties for the wizard’s Cancel button

FinishCompleteButtonStyle

Sets the style properties for the wizard’s Finish button

FinishPreviousButtonStyle

Sets the style properties for the wizard’s Previous button when at the finish step

HeaderStyle

Sets the style properties for the wizard’s header

NavigationButtonStyle

Sets the style properties for navigation buttons

NavigationStyle

Sets the style properties for the navigation area

SideBarButtonStyle

Sets the style properties for the buttons on the sidebar

SideBarStyle

Sets the style properties for the wizard’s sidebar

StartStepNextButtonStyle

Sets the style properties for the wizard’s Next button when at the start step

StepNextButtonStyle

Sets the style properties for the wizard’s Next button

StepPreviousButtonStyle

Sets the style properties for the wizard’s Previous button

StepStyle

Sets the style properties for the area where steps are displayed

The contents of the header, sidebar, and navigation bar can be further customized with templates. Table 9-6 lists the available templates.

Table 9-6. The Wizard Control’s Template Properties

Style

Description

FinishNavigationTemplate

Specifies the navigation bar shown before the last page of the wizard. By default, the navigation bar contains the Previous and Finish buttons.

HeaderTemplate

Specifies the title bar of the wizard.

SideBarTemplate

Used to display content on the left side of the wizard control.

StartNavigationTemplate

Specifies the navigation bar for the first view in the wizard. By default, it contains only the Next button.

StepNavigationTemplate

Specifies the navigation bar for steps other than first, finish, or complete. By default, it contains Previous and Next buttons.

In addition to using styles and templates, you can control the programming interface of the Wizard control through a few properties.

The Wizard’s Programming Interface


Table 9-7 lists the properties of the Wizard control, excluding style and template properties and properties defined on base classes.

Table 9-7. Main Properties of the Wizard Control

Property

Description

ActiveStep

Returns the current wizard step object. The object is an instance of the WizardStep class.

ActiveStepIndex

Gets and sets the 0-based index of the current wizard step.

DisplayCancelButton

Toggles the visibility of the Cancel button. The default value is false.

DisplaySideBar

Toggles the visibility of the sidebar. The default value is false.

HeaderText

Gets and sets the title of the wizard.

SkipLinkText

The ToolTip string that the control associates with an invisible image, as a hint to screen readers. The default value is “Skip Navigation Links” and is localized based on the server’s current locale.

WizardSteps

Returns a collection

Return Main Page Previous Page Next Page

®Online Book Reader