Export (0) Print
Expand All

Wizard Class

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

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

[BindableAttribute(false)]
public class Wizard : CompositeControl
<asp:Wizard />

The Wizard type exposes the following members.

  NameDescription
Public methodWizardInitializes a new instance of the Wizard class.
Top

  NameDescription
Public propertyAccessKeyGets or sets the access key that allows you to quickly navigate to the Web server control. (Inherited from WebControl.)
Public propertyActiveStepGets the step in the WizardSteps collection that is currently displayed to the user.
Public propertyActiveStepIndexGets or sets the index of the current WizardStepBase object.
Protected propertyAdapterGets the browser-specific adapter for the control. (Inherited from Control.)
Public propertyAppRelativeTemplateSourceDirectoryGets or sets the application-relative virtual directory of the Page or UserControl object that contains this control. (Inherited from Control.)
Public propertyAttributesGets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control. (Inherited from WebControl.)
Public propertyBackColorGets or sets the background color of the Web server control. (Inherited from WebControl.)
Public propertyBindingContainerInfrastructure. Gets the control that contains this control's data binding. (Inherited from Control.)
Public propertyBorderColorGets or sets the border color of the Web control. (Inherited from WebControl.)
Public propertyBorderStyleGets or sets the border style of the Web server control. (Inherited from WebControl.)
Public propertyBorderWidthGets or sets the border width of the Web server control. (Inherited from WebControl.)
Public propertyCancelButtonImageUrlGets or sets the URL of the image displayed for the Cancel button.
Public propertyCancelButtonStyleGets a reference to a collection of style properties that define the appearance of the Cancel button.
Public propertyCancelButtonTextGets or sets the text caption that is displayed for the Cancel button.
Public propertyCancelButtonTypeGets or sets the type of button that is rendered as the Cancel button.
Public propertyCancelDestinationPageUrlGets or sets the URL that the user is directed to when they click the Cancel button.
Public propertyCellPaddingGets or sets the amount of space between the contents of the cell and the cell border.
Public propertyCellSpacingGets or sets the amount of space between cells.
Protected propertyChildControlsCreatedGets a value that indicates whether the server control's child controls have been created. (Inherited from Control.)
Public propertyClientIDGets the control ID for HTML markup that is generated by ASP.NET. (Inherited from Control.)
Public propertyClientIDModeGets or sets the algorithm that is used to generate the value of the ClientID property. (Inherited from Control.)
Protected propertyClientIDSeparatorGets a character value representing the separator character used in the ClientID property. (Inherited from Control.)
Protected propertyContextGets the HttpContext object associated with the server control for the current Web request. (Inherited from Control.)
Public propertyControlsGets a ControlCollection object that represents the child controls in a CompositeControl. (Inherited from CompositeControl.)
Public propertyControlStyleGets the style of the Web server control. This property is used primarily by control developers. (Inherited from WebControl.)
Public propertyControlStyleCreatedGets a value indicating whether a Style object has been created for the ControlStyle property. This property is primarily used by control developers. (Inherited from WebControl.)
Public propertyCssClassGets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client. (Inherited from WebControl.)
Public propertyDataItemContainerGets a reference to the naming container if the naming container implements IDataItemContainer. (Inherited from Control.)
Public propertyDataKeysContainerGets a reference to the naming container if the naming container implements IDataKeysControl. (Inherited from Control.)
Protected propertyDesignModeGets a value indicating whether a control is being used on a design surface. (Inherited from Control.)
Public propertyDisplayCancelButtonGets or sets a Boolean value indicating whether to display a Cancel button.
Public propertyDisplaySideBarGets or sets a Boolean value indicating whether to display the sidebar area on the Wizard control.
Public propertyEnabledGets or sets a value indicating whether the Web server control is enabled. (Inherited from WebControl.)
Public propertyEnableThemingGets or sets a value indicating whether themes apply to this control. (Inherited from WebControl.)
Public propertyEnableViewStateGets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client. (Inherited from Control.)
Protected propertyEventsGets a list of event handler delegates for the control. This property is read-only. (Inherited from Control.)
Public propertyFinishCompleteButtonImageUrlGets or sets the URL of the image that is displayed for the Finish button.
Public propertyFinishCompleteButtonStyleGets a reference to a Style object that defines the settings for the Finish button.
Public propertyFinishCompleteButtonTextGets or sets the text caption that is displayed for the Finish button.
Public propertyFinishCompleteButtonTypeGets or sets the type of button that is rendered as the Finish button.
Public propertyFinishDestinationPageUrlGets or sets the URL that the user is redirected to when they click the Finish button.
Public propertyFinishNavigationTemplateGets or sets the template that is used to display the navigation area on the Finish step.
Public propertyFinishPreviousButtonImageUrlGets or sets the URL of the image that is displayed for the Previous button on the Finish step.
Public propertyFinishPreviousButtonStyleGets a reference to a Style object that defines the settings for the Previous button on the Finish step.
Public propertyFinishPreviousButtonTextGets or sets the text caption that is displayed for the Previous button on the Finish step.
Public propertyFinishPreviousButtonTypeGets or sets the type of button that is rendered as the Previous button on the Finish step.
Public propertyFontGets the font properties associated with the Web server control. (Inherited from WebControl.)
Public propertyForeColorGets or sets the foreground color (typically the color of the text) of the Web server control. (Inherited from WebControl.)
Public propertyHasAttributesGets a value indicating whether the control has attributes set. (Inherited from WebControl.)
Protected propertyHasChildViewStateGets a value indicating whether the current server control's child controls have any saved view-state settings. (Inherited from Control.)
Public propertyHeaderStyleGets a reference to a Style object that defines the settings for the header area on the control.
Public propertyHeaderTemplateGets or sets the template that is used to display the header area on the control.
Public propertyHeaderTextGets or sets the text caption that is displayed for the header area on the control.
Public propertyHeightGets or sets the height of the Web server control. (Inherited from WebControl.)
Public propertyIDGets or sets the programmatic identifier assigned to the server control. (Inherited from Control.)
Protected propertyIdSeparatorInfrastructure. Gets the character used to separate control identifiers. (Inherited from Control.)
Protected propertyIsChildControlStateClearedGets a value indicating whether controls contained within this control have control state. (Inherited from Control.)
Protected propertyIsEnabledGets a value indicating whether the control is enabled. (Inherited from WebControl.)
Protected propertyIsTrackingViewStateGets a value that indicates whether the server control is saving changes to its view state. (Inherited from Control.)
Protected propertyIsViewStateEnabledGets a value indicating whether view state is enabled for this control. (Inherited from Control.)
Public propertyLayoutTemplateGets or sets the custom content of the root container in a Wizard control.
Protected propertyLoadViewStateByIDGets a value indicating whether the control participates in loading its view state by ID instead of index. (Inherited from Control.)
Public propertyNamingContainerGets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same Control.ID property value. (Inherited from Control.)
Public propertyNavigationButtonStyleGets a reference to a Style object that defines the settings for the buttons in the navigation area on the control.
Public propertyNavigationStyleGets a reference to a Style object that defines the settings for the navigation area on the control.
Public propertyPageGets a reference to the Page instance that contains the server control. (Inherited from Control.)
Public propertyParentGets a reference to the server control's parent control in the page control hierarchy. (Inherited from Control.)
Public propertyRenderingCompatibilityGets a value that specifies the ASP.NET version that rendered HTML will be compatible with. (Inherited from Control.)
Public propertySideBarButtonStyleGets a reference to a Style object that defines the settings for the buttons on the sidebar.
Public propertySideBarStyleGets a reference to a Style object that defines the settings for the sidebar area on the control.
Public propertySideBarTemplateGets or sets the template that is used to display the sidebar area on the control.
Public propertySiteGets information about the container that hosts the current control when rendered on a design surface. (Inherited from Control.)
Public propertySkinIDGets or sets the skin to apply to the control. (Inherited from WebControl.)
Public propertySkipLinkTextGets or sets a value that is used to render alternate text that notifies screen readers to skip the content in the sidebar area.
Public propertyStartNavigationTemplateGets or sets the template that is used to display the navigation area on the Start step of the Wizard control.
Public propertyStartNextButtonImageUrlGets or sets the URL of the image that is displayed for the Next button on the Start step.
Public propertyStartNextButtonStyleGets a reference to a Style object that defines the settings for the Next button on the Start step.
Public propertyStartNextButtonTextGets or sets the text caption that is displayed for the Next button on the Start step.
Public propertyStartNextButtonTypeGets or sets the type of button that is rendered as the Next button on the Start step.
Public propertyStepNavigationTemplateGets or sets the template that is used to display the navigation area on any WizardStepBase-derived objects other than the Start, the Finish, or Complete step.
Public propertyStepNextButtonImageUrlGets or sets the URL of the image that is displayed for the Next button.
Public propertyStepNextButtonStyleGets a reference to the Style object that defines the settings for the Next button.
Public propertyStepNextButtonTextGets or sets the text caption that is displayed for the Next button.
Public propertyStepNextButtonTypeGets or sets the type of button that is rendered as the Next button.
Public propertyStepPreviousButtonImageUrlGets or sets the URL of the image that is displayed for the Previous button.
Public propertyStepPreviousButtonStyleGets a reference to a Style object that defines the settings for the Previous button.
Public propertyStepPreviousButtonTextGets or sets the text caption that is displayed for the Previous button.
Public propertyStepPreviousButtonTypeGets or sets the type of button that is rendered as the Previous button.
Public propertyStepStyleGets a reference to a Style object that defines the settings for the WizardStep objects.
Public propertyStyleGets a collection of text attributes that will be rendered as a style attribute on the outer tag of the Web server control. (Inherited from WebControl.)
Public propertySupportsDisabledAttributeGets a value that indicates whether the control should set the disabled attribute of the rendered HTML element to "disabled" when the control's IsEnabled property is false. (Inherited from CompositeControl.)
Public propertyTabIndexGets or sets the tab index of the Web server control. (Inherited from WebControl.)
Protected propertyTagKeyGets the HtmlTextWriterTag value that corresponds to the Wizard control. (Overrides WebControl.TagKey.)
Protected propertyTagNameGets the name of the control tag. This property is used primarily by control developers. (Inherited from WebControl.)
Public propertyTemplateControlGets or sets a reference to the template that contains this control. (Inherited from Control.)
Public propertyTemplateSourceDirectoryGets the virtual directory of the Page or UserControl that contains the current server control. (Inherited from Control.)
Public propertyToolTipGets or sets the text displayed when the mouse pointer hovers over the Web server control. (Inherited from WebControl.)
Public propertyUniqueIDGets the unique, hierarchically qualified identifier for the server control. (Inherited from Control.)
Protected propertyViewStateGets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page. (Inherited from Control.)
Protected propertyViewStateIgnoresCaseGets a value that indicates whether the StateBag object is case-insensitive. (Inherited from Control.)
Public propertyViewStateModeGets or sets the view-state mode of this control. (Inherited from Control.)
Public propertyVisibleGets or sets a value that indicates whether a server control is rendered as UI on the page. (Inherited from Control.)
Public propertyWidthGets or sets the width of the Web server control. (Inherited from WebControl.)
Public propertyWizardStepsGets a collection containing all the WizardStepBase objects that are defined for the control.
Top

  NameDescription
Protected methodAddAttributesToRenderAdds HTML attributes and styles that need to be rendered to the specified HtmlTextWriterTag. This method is used primarily by control developers. (Inherited from WebControl.)
Protected methodAddedControlCalled after a child control is added to the Controls collection of the Control object. (Inherited from Control.)
Protected methodAddParsedSubObjectNotifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object. (Inherited from Control.)
Protected methodAllowNavigationToStepUses a Boolean value to determine whether the ActiveStep property can be set to the WizardStepBase object that corresponds to the index that is passed in.
Public methodApplyStyleCopies any nonblank elements of the specified style to the Web control, overwriting any existing style elements of the control. This method is primarily used by control developers. (Inherited from WebControl.)
Public methodApplyStyleSheetSkinApplies the style properties defined in the page style sheet to the control. (Inherited from Control.)
Protected methodBuildProfileTreeInfrastructure. Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page. (Inherited from Control.)
Protected methodClearCachedClientIDInfrastructure. Sets the cached ClientID value to null. (Inherited from Control.)
Protected methodClearChildControlStateDeletes the control-state information for the server control's child controls. (Inherited from Control.)
Protected methodClearChildStateDeletes the view-state and control-state information for all the server control's child controls. (Inherited from Control.)
Protected methodClearChildViewStateDeletes the view-state information for all the server control's child controls. (Inherited from Control.)
Protected methodClearEffectiveClientIDModeInfrastructure. Sets the ClientIDMode property of the current control instance and of any child controls to Inherit. (Inherited from Control.)
Public methodCopyBaseAttributesCopies the properties not encapsulated by the Style object from the specified Web server control to the Web server control that this method is called from. This method is used primarily by control developers. (Inherited from WebControl.)
Protected methodCreateChildControlsCalled by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. (Overrides Control.CreateChildControls().)
Protected methodCreateControlCollectionCreates a new ControlCollection object to hold the child controls (both literal and server) of the server control. (Overrides Control.CreateControlCollection().)
Protected methodCreateControlHierarchyCreates the hierarchy of child controls that make up the control.
Protected methodCreateControlStyleCreates the style object that is used internally by the WebControl class to implement all style related properties. This method is used primarily by control developers. (Overrides WebControl.CreateControlStyle().)
Public methodDataBind()Binds a data source to the CompositeControl and all its child controls. (Inherited from CompositeControl.)
Protected methodDataBind(Boolean)Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event. (Inherited from Control.)
Protected methodDataBindChildrenBinds a data source to the server control's child controls. (Inherited from Control.)
Public methodDisposeEnables a server control to perform final clean up before it is released from memory. (Inherited from Control.)
Protected methodEnsureChildControlsDetermines whether the server control contains child controls. If it does not, it creates child controls. (Inherited from Control.)
Protected methodEnsureIDCreates an identifier for controls that do not have an identifier assigned. (Inherited from Control.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodFindControl(String)Searches the current naming container for a server control with the specified id parameter. (Inherited from Control.)
Protected methodFindControl(String, Int32)Infrastructure. Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. You should not override this version of the FindControl method. (Inherited from Control.)
Public methodFocusSets input focus to a control. (Inherited from Control.)
Protected methodGetDesignModeStateGets design-time data for a control. (Overrides Control.GetDesignModeState().)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetHistoryReturns a collection of WizardStepBase objects that have been accessed.
Public methodGetRouteUrl(Object)Gets the URL that corresponds to a set of route parameters. (Inherited from Control.)
Public methodGetRouteUrl(RouteValueDictionary)Gets the URL that corresponds to a set of route parameters. (Inherited from Control.)
Public methodGetRouteUrl(String, Object)Gets the URL that corresponds to a set of route parameters and a route name. (Inherited from Control.)
Public methodGetRouteUrl(String, RouteValueDictionary)Gets the URL that corresponds to a set of route parameters and a route name. (Inherited from Control.)
Public methodGetStepTypeReturns the WizardStepType value for the specified WizardStepBase object.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetUniqueIDRelativeToReturns the prefixed portion of the UniqueID property of the specified control. (Inherited from Control.)
Public methodHasControlsDetermines if the server control contains any child controls. (Inherited from Control.)
Protected methodHasEventsReturns a value indicating whether events are registered for the control or any child controls. (Inherited from Control.)
Protected methodIsLiteralContentInfrastructure. Determines if the server control holds only literal content. (Inherited from Control.)
Protected methodLoadControlStateRestores control-state information from a previous page request that was saved by the SaveControlState method. (Overrides Control.LoadControlState(Object).)
Protected methodLoadViewStateRestores view-state information from a previous request that was saved with the SaveViewState method. (Overrides WebControl.LoadViewState(Object).)
Protected methodMapPathSecureRetrieves the physical path that a virtual path, either absolute or relative, maps to. (Inherited from Control.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodMergeStyleCopies any nonblank elements of the specified style to the Web control, but will not overwrite any existing style elements of the control. This method is used primarily by control developers. (Inherited from WebControl.)
Public methodMoveToSets the specified WizardStepBase-derived object as the value for the ActiveStep property of the Wizard control.
Protected methodOnActiveStepChangedRaises the ActiveStepChanged event.
Protected methodOnBubbleEventDetermines whether the event for the server control is passed up the page's UI server control hierarchy. (Overrides Control.OnBubbleEvent(Object, EventArgs).)
Protected methodOnCancelButtonClickRaises the CancelButtonClick event.
Protected methodOnDataBindingRaises the DataBinding event. (Inherited from Control.)
Protected methodOnFinishButtonClickRaises the FinishButtonClick event.
Protected methodOnInitRaises the Init event. (Overrides Control.OnInit(EventArgs).)
Protected methodOnLoadRaises the Load event. (Inherited from Control.)
Protected methodOnNextButtonClickRaises the NextButtonClick event.
Protected methodOnPreRenderRaises the PreRender event. (Inherited from Control.)
Protected methodOnPreviousButtonClickRaises the PreviousButtonClick event.
Protected methodOnSideBarButtonClickRaises the SideBarButtonClick event.
Protected methodOnUnloadRaises the Unload event. (Inherited from Control.)
Protected methodOpenFileGets a Stream used to read a file. (Inherited from Control.)
Protected methodRaiseBubbleEventAssigns any sources of the event and its information to the control's parent. (Inherited from Control.)
Protected methodRecreateChildControlsRecreates the child controls in a control derived from CompositeControl. (Inherited from CompositeControl.)
Protected methodRegisterCommandEventsRegisters a new instance of the CommandEventHandler class for the specified IButtonControl object.
Protected methodRemovedControlCalled after a child control is removed from the Controls collection of the Control object. (Inherited from Control.)
Protected methodRenderWrites the CompositeControl content to the specified HtmlTextWriter object, for display on the client. (Overrides CompositeControl.Render(HtmlTextWriter).)
Public methodRenderBeginTagRenders the HTML opening tag of the control to the specified writer. This method is used primarily by control developers. (Inherited from WebControl.)
Protected methodRenderChildrenOutputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client. (Inherited from Control.)
Protected methodRenderContentsRenders the contents of the control to the specified writer. This method is used primarily by control developers. (Inherited from WebControl.)
Public methodRenderControl(HtmlTextWriter)Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled. (Inherited from Control.)
Protected methodRenderControl(HtmlTextWriter, ControlAdapter)Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object. (Inherited from Control.)
Public methodRenderEndTagRenders the HTML closing tag of the control into the specified writer. This method is used primarily by control developers. (Inherited from WebControl.)
Protected methodResolveAdapterGets the control adapter responsible for rendering the specified control. (Inherited from Control.)
Public methodResolveClientUrlGets a URL that can be used by the browser. (Inherited from Control.)
Public methodResolveUrlConverts a URL into one that is usable on the requesting client. (Inherited from Control.)
Protected methodSaveControlStateSaves any server control state changes that have occurred since the time the page was posted back to the server. (Overrides Control.SaveControlState().)
Protected methodSaveViewStateSaves any state that was modified after the TrackViewState method was invoked. (Overrides WebControl.SaveViewState().)
Protected methodSetDesignModeStateSets design-time data for a control. (Inherited from Control.)
Public methodSetRenderMethodDelegateInfrastructure. Assigns an event handler delegate to render the server control and its content into its parent control. (Inherited from Control.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodTrackViewStateCauses the control to track changes to its view state so they can be stored in the object's ViewState property. (Overrides WebControl.TrackViewState().)
Top

  NameDescription
Public eventActiveStepChangedOccurs when the user switches to a new step in the control.
Public eventCancelButtonClickOccurs when the Cancel button is clicked.
Public eventDataBindingOccurs when the server control binds to a data source. (Inherited from Control.)
Public eventDisposedOccurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested. (Inherited from Control.)
Public eventFinishButtonClickOccurs when the Finish button is clicked.
Public eventInitOccurs when the server control is initialized, which is the first step in its lifecycle. (Inherited from Control.)
Public eventLoadOccurs when the server control is loaded into the Page object. (Inherited from Control.)
Public eventNextButtonClickOccurs when the Next button is clicked.
Public eventPreRenderOccurs after the Control object is loaded but prior to rendering. (Inherited from Control.)
Public eventPreviousButtonClickOccurs when the Previous button is clicked.
Public eventSideBarButtonClickOccurs when a button in the sidebar area is clicked.
Public eventUnloadOccurs when the server control is unloaded from memory. (Inherited from Control.)
Top

  NameDescription
Public Extension MethodFindDataSourceControlReturns the data source that is associated with the data control for the specified control. (Defined by DynamicDataExtensions.)
Public Extension MethodFindFieldTemplateReturns the field template for the specified column in the specified control's naming container. (Defined by DynamicDataExtensions.)
Public Extension MethodFindMetaTableReturns the metatable object for the containing data control. (Defined by DynamicDataExtensions.)
Top

  NameDescription
Protected fieldStatic memberCancelButtonIDSpecifies the identifier for the Cancel button. This field is static and read-only.
Public fieldStatic memberCancelCommandNameRetrieves the command name for the Cancel button. This field is static and read-only.
Protected fieldStatic memberCustomFinishButtonIDRetrieves the identifier for a custom Finish button. This field is static and read-only.
Protected fieldStatic memberCustomNextButtonIDRetrieves the identifier for a custom Next button. This field is static and read-only.
Protected fieldStatic memberCustomPreviousButtonIDRetrieves the identifier for a custom Previous button. This field is static and read-only.
Protected fieldStatic memberDataListIDRetrieves the identifier for the sidebar DataList collection. This field is static and read-only.
Protected fieldStatic memberFinishButtonIDRetrieves the identifier for the Finish button. This field is static and read-only.
Protected fieldStatic memberFinishPreviousButtonIDRetrieves the identifier for the Previous button on the Finish step. This field is static and read-only.
Public fieldStatic memberHeaderPlaceholderIdGets the ID of the HeaderTemplate placeholder in a Wizard control.
Public fieldStatic memberMoveCompleteCommandNameRetrieves the command name that is associated with the Finish button. This field is static and read-only.
Public fieldStatic memberMoveNextCommandNameRetrieves the command name that is associated with the Next button. This field is static and read-only.
Public fieldStatic memberMovePreviousCommandNameRetrieves the command name that is associated with the Previous button. This field is static and read-only.
Public fieldStatic memberMoveToCommandNameRetrieves the command name that is associated with each of the sidebar buttons. This field is static and read-only.
Public fieldStatic memberNavigationPlaceholderIdGets the ID of the StartNavigationTemplate placeholder in a Wizard control.
Protected fieldStatic memberSideBarButtonIDRetrieves the identifier that is associated with each of the sidebar buttons. This field is static and read-only.
Public fieldStatic memberSideBarPlaceholderIdGets the ID of the SideBarTemplate placeholder in a Wizard control.
Protected fieldStatic memberStartNextButtonIDRetrieves the identifier that is associated with the Next button on the Start step. This field is static and read-only.
Protected fieldStatic memberStepNextButtonIDRetrieves the identifier that is associated with the Next button. This field is static and read-only.
Protected fieldStatic memberStepPreviousButtonIDRetrieves the identifier that is associated with the Previous button. This field is static and read-only.
Public fieldStatic memberWizardStepPlaceholderIdGets the ID of the WizardStep placeholder in a Wizard control.
Top

  NameDescription
Explicit interface implemetationPrivate methodIAttributeAccessor.GetAttributeInfrastructure. Gets an attribute of the Web control with the specified name. (Inherited from WebControl.)
Explicit interface implemetationPrivate methodIAttributeAccessor.SetAttributeSets an attribute of the Web control to the specified name and value. (Inherited from WebControl.)
Explicit interface implemetationPrivate methodICompositeControlDesignerAccessor.RecreateChildControlsEnables a designer to recreate the composite control's collection of child controls in the design-time environment. (Inherited from CompositeControl.)
Explicit interface implemetationPrivate propertyIControlBuilderAccessor.ControlBuilderFor a description of this member, see IControlBuilderAccessor.ControlBuilder. (Inherited from Control.)
Explicit interface implemetationPrivate methodIControlDesignerAccessor.GetDesignModeStateFor a description of this member, see IControlDesignerAccessor.GetDesignModeState. (Inherited from Control.)
Explicit interface implemetationPrivate methodIControlDesignerAccessor.SetDesignModeStateFor a description of this member, see IControlDesignerAccessor.SetDesignModeState. (Inherited from Control.)
Explicit interface implemetationPrivate methodIControlDesignerAccessor.SetOwnerControlInfrastructure. For a description of this member, see IControlDesignerAccessor.SetOwnerControl. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIControlDesignerAccessor.UserDataFor a description of this member, see IControlDesignerAccessor.UserData. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIDataBindingsAccessor.DataBindingsFor a description of this member, see IDataBindingsAccessor.DataBindings. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIDataBindingsAccessor.HasDataBindingsFor a description of this member, see IDataBindingsAccessor.HasDataBindings. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIExpressionsAccessor.ExpressionsFor a description of this member, see IExpressionsAccessor.Expressions. (Inherited from Control.)
Explicit interface implemetationPrivate propertyIExpressionsAccessor.HasExpressionsFor a description of this member, see IExpressionsAccessor.HasExpressions. (Inherited from Control.)
Explicit interface implemetationPrivate methodIParserAccessor.AddParsedSubObjectFor a description of this member, see IParserAccessor.AddParsedSubObject. (Inherited from Control.)
Top

In this topic:

Introduction

You can use the Wizard control to:

  • Collect related data across multiple steps.

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

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

Wizard Components

The Wizard control is made up of the following components:

  • A WizardStepCollection collection of steps that contain 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 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.

    NoteNote

    If you are using Microsoft Visual Studio 2005, note that the ActiveStepIndex is persisted in Source view. If you change the WizardSteps property in Design view by clicking the sidebar buttons, and you then run the page, the first step of the Wizard control might not be shown because the ActiveStepIndex might be pointing to a different step.

Wizard Steps

Each of the steps in the Wizard control has a StepType property that determines the kind of navigation functionality that the step has. If you do not specify a value for the StepType property, the default value is Auto. The following table lists the available settings for the StepType property and the resulting behavior of the step.

WizardStepType.Auto

The navigation UI that is rendered for the step is determined by the order in which the step is declared.

WizardStepType.Complete

The step is the last one to appear. No navigation buttons are rendered.

WizardStepType.Finish

The step is the last one that collects user data. The Finish button is rendered for navigation.

WizardStepType.Start

The step is the first one to appear. A Previous button is not rendered.

WizardStepType.Step

The step is any step between the first and last. Previous and Next buttons are rendered for navigation.

Collecting Wizard Data

Using the Wizard control, data can be collected through linear or nonlinear navigation. Some examples of nonlinear navigation are skipping unnecessary steps or returning to a previously completed step to change some value. The Wizard control maintains its state between steps, so the data entered on a step does not need to be persisted to a data store until all the steps of the Wizard control have been completed.

Alternatively, if you want to persist the collected data to a data store as each step is completed, such as when the NextButtonClick event is raised, you should set the AllowReturn property of the WizardStepBase object to false so that the user cannot return to a previously completed step and change the data once it has been submitted.

Wizard Command Names

The Wizard control inherits the following command names from the View class and MultiView class: NextViewCommandName, PreviousViewCommandName, SwitchViewByIDCommandName, and SwitchViewByIndexCommandName. The Wizard control ignores these command names and does not include any special logic to enable these commands to automatically work for navigation. If a command name is removed or is missing from a button in the Wizard control, no exception is thrown. For example, if the StartNavigationTemplate button is missing a value for CommandName, no exception is thrown.

Dynamically Changing Steps

You can use the MoveTo method or the ActiveStepIndex property to dynamically change the step that is currently displayed in the Wizard control.

NoteNote

If you programmatically add a WizardStep in the Page_Load event handler, you must add the navigation to that step prior to the page loading.

Wizard Appearance

The appearance of the Wizard control is fully customizable through templates, skins, and style settings. For example, you can use the HeaderTemplate, SideBarTemplate, StartNavigationTemplate, FinishNavigationTemplate, and StepNavigationTemplate properties to customize the interface of the Wizard control.

NoteNote

Setting the FinishNavigationTemplate, DisplaySideBar, HeaderTemplate, SideBarTemplate, StartNavigationTemplate, or StepNavigationTemplate property recreates the child controls of the Wizard control. As a result, the view state for the child controls is lost in the process. To avoid this situation, explicitly maintain the control state of the Wizard control's child controls explicitly, or avoid putting controls inside of templates.

Note that the Wizard control does not support special Microsoft Internet Explorer rendering for non-standard or quirks mode. To get the best Internet Explorer rendering using the Wizard control, use the XHTML doc type, which is added by default in Visual Web Developer and Visual Studio.

Formatting Using Layout Templates

The Wizard control lets you specify the layout of the control without requiring you to use an HTML table element. Instead, you can use a LayoutTemplate element to specify the layout. In the template, you create placeholder controls to indicate where items should be dynamically inserted into the control. (This is similar to how the template model for the ListView control works.) For more information, see the Wizard.LayoutTemplate property.

Accessibility

For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio and ASP.NET and ASP.NET Controls and Accessibility.

Declarative Syntax

<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>
TopicLocation
How to: Customize the ASP.NET CreateUserWizard ControlBuilding ASP .NET Web Applications
How to: Customize the ASP.NET CreateUserWizard ControlBuilding ASP .NET Web Applications
Walkthrough: Creating a Basic ASP.NET Wizard ControlBuilding ASP .NET Web Applications in Visual Studio
Walkthrough: Advanced Use of the ASP.NET Wizard ControlBuilding ASP .NET Web Applications in Visual Studio
Walkthrough: Advanced Use of the ASP.NET Wizard ControlBuilding ASP .NET Web Applications in Visual Studio

The following code example demonstrates how to define a Wizard control to collect a user's name and address, with the option to enter a separate shipping address. If the user does not select SeparateShippingCheckBox, thereby issuing a request to add a separate shipping address, the Wizard control moves directly from Step2 to Finish. On the Finish step, the user has the option to return to the beginning of the Wizard control by clicking GoBackButton; however, it takes the user to Step2 because the AllowReturn property for Step1 is set to false.

Security noteSecurity Note

This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.


<%@ Page Language="C#" CodeFile="WizardClass.cs" Inherits="WizardClasscs_aspx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<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" 
        onfinishbuttonclick="OnFinishButtonClick" 
        backcolor="#EFF3FB" 
        font-names="Verdana" 
        font-size="0.8em"
        borderwidth="1px" 
        bordercolor="#B5C7DE" 
        style="font-size: medium; font-family: Verdana;" 
        onactivestepchanged="OnActiveStepChanged">       
      <StepStyle forecolor="#333333" 
        font-size="0.8em" />
        <WizardSteps>        
          <asp:WizardStep id="Step1" 
            title="One"
            allowreturn="false" 
            runat="server" >
            Welcome to the Wizard example.  This step's AllowReturn property is set 
            to false, so after you leave this step you will not be able to return to it.
          </asp:WizardStep>          
          <asp:WizardStep id="Step2"
            title="Two" 
            runat="server" >
            <!-- ... Put UI elements here ... -->
            Please enter your billing information.
            <br />
            Name:<br />
            <asp:TextBox runat="server" 
              id="BillingName" 
              width="226px" 
              height="17px" /> 
            <br />
            E-mail Address:<br />
            <asp:TextBox runat="server" 
              id="EmailAddress" 
              width="224px" 
              height="17px" />
            <br />
            Address Line 1: <br />
            <asp:TextBox runat="server" 
              id="BillingAddressLine1" 
              width="314px" 
              height="17px" />
            <br />
            Address Line 2: <br />
            <asp:TextBox runat="server" 
              id="BillingAddressLine2" 
              width="314px" 
              height="17px" />
            <br />
            City: <br />
            <asp:TextBox runat="server" 
              id="BillingCity" 
              width="155px" 
              height="17px" /> 
            <br />
            State: <br />
            <asp:TextBox runat="server" 
              id="BillingState" 
              width="75px" 
              height="17px" /> 
            <br />
            ZIP Code: <br />
            <asp:TextBox runat="server" 
              id="BillingZip" 
              height="17px" />
            <br /><br />
            <asp:CheckBox runat="server" 
              id="SeparateShippingCheckBox" 
              text="Please check here if you would like to add a separate shipping address." />
          </asp:WizardStep>          
          <asp:WizardStep id="Step3" 
            title="Three" 
            runat="server" >
            <!-- Gather the shipping address in this step if CheckBox1 was selected. -->
            Please enter your shipping information.
            <br />
                Name:<br />
                <asp:TextBox runat="server" 
                  id="ShippingName" 
                  height="17px" /> 
                <br />
                Address Line 1: <br />
                <asp:TextBox runat="server" 
                  id="ShippingAddress1" 
                  width="370px" 
                  height="17px" />
                <br />
                Address Line 2: <br />
                <asp:TextBox runat="server" 
                  id="ShippingAddress2" 
                  width="370px" 
                  height="17px" />
                <br />
                City: <br />
                <asp:TextBox runat="server" 
                  id="ShippingCity" 
                  height="17px" /> 
                <br />
                State: <br />
                <asp:TextBox runat="server" 
                  id="ShippingState" 
                  width="65px" 
                  height="17px" />
                <br /> 
                ZIP Code: <br />
                <asp:TextBox runat="server" 
                  id="ShippingZip" 
                  height="17px" />
          </asp:WizardStep>
          <asp:WizardStep id="Finish" 
            title="Finish"
            runat="server" >
            <!-- Put UI elements here for the Finish step. -->
            <asp:Button runat="server" 
              id="GoBackButton" 
              text="Go Back to Step 2" 
              onclick="OnGoBackButtonClick"
              forecolor="#284E98" 
              font-names="Verdana"
              font-size="1.0em" 
              borderstyle="Solid" 
              borderwidth="1px" 
              bordercolor="#507CD1" 
              backcolor="White" /> 
          </asp:WizardStep>          
          <asp:WizardStep runat="server" 
            steptype="Complete" 
            title="Complete" 
            id="Complete">
            <asp:Label runat="server" 
              id="CompleteMessageLabel" 
              width="408px" 
              height="24px">
            </asp:Label>
          </asp:WizardStep>
        </WizardSteps> 
        <NavigationButtonStyle forecolor="#284E98" 
          font-names="Verdana"
          font-size="1.0em" 
          borderstyle="Solid" 
          borderwidth="1px" 
          bordercolor="#507CD1" 
          backcolor="White" />
        <HeaderStyle forecolor="White" 
          horizontalalign="Center" 
          font-size="0.9em" 
          font-bold="True"
          backcolor="#284E98" 
          borderstyle="Solid" 
          bordercolor="#EFF3FB" 
          borderwidth="2px" />
        <SideBarStyle verticalalign="Top" 
          horizontalalign="Center"
          font-size="0.8em" 
          forecolor="#000099"
          backcolor="#EFF3FB"
          width="45px" />
        <HeaderTemplate>
          <b>Wizard Example</b>
        </HeaderTemplate>
      </asp:Wizard>
    </form>
  </body>
</html>


The following code example is the code-behind file for the Web page used in the preceding example.


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class WizardClasscs_aspx : System.Web.UI.Page
{
    protected void OnFinishButtonClick(Object sender, WizardNavigationEventArgs e)
    {
        // The OnFinishButtonClick method is a good place to collect all
        // the data from the completed pages and persist it to the data store. 

        // For this example, write a confirmation message to the Complete page
        // of the Wizard control.
        Label tempLabel = (Label)Wizard1.FindControl("CompleteMessageLabel");
        if (tempLabel != null)
        {
            tempLabel.Text = "Your order has been placed. An e-mail confirmation will be sent to "
            + (EmailAddress.Text.Length == 0 ? "your e-mail address" : EmailAddress.Text) + ".";
        }
    }

    protected void OnGoBackButtonClick(object sender, EventArgs e)
    {
        // The GoBackButtonClick event is raised when the GoBackButton
        // is clicked on the Finish page of the Wizard.  

        // Check the value of Step1's AllowReturn property.
        if (Step1.AllowReturn)
        {
            // Return to Step1.
            Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(this.Step1);
        }
        else
        {
            // Step1 is not a valid step to return to; go to Step2 instead.
            Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(this.Step2);
            Response.Write("ActiveStep is set to Step2 because Step1 has AllowReturn set to false.");
        }
    }

    protected void OnActiveStepChanged(object sender, EventArgs e)
    {
        // If the ActiveStep is changing to Step3, check to see whether the 
        // SeparateShippingCheckBox is selected.  If it is not, skip to the
        // Finish step.
        if (Wizard1.ActiveStepIndex == Wizard1.WizardSteps.IndexOf(this.Step3))
        {
            if (this.SeparateShippingCheckBox.Checked)
            {
                Wizard1.MoveTo(this.Step3);
            }
            else
            {
                Wizard1.MoveTo(this.Finish);
            }
        }
    }
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft