WizardStepBase::ID Property

 

Gets or sets the programmatic identifier assigned to the server control.

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

public:
property String^ ID {
	virtual String^ get() override;
	virtual void set(String^ value) override;
}

Property Value

Type: System::String^

The programmatic identifier assigned to the control.

Exception Condition
ArgumentException

The property was set to an invalid identifier string at design time.

-or-

The property was set to the same identifier as the containing Wizard control at design time.

-or-

The property was set to the same identifier as another step in the containing Wizard control at design time.

Use the ID property to identify and reference a particular wizard step control in a Web Forms page. The ID value becomes the name of the control instance in the page; this allows you to easily access a particular step in code for that page. For example, if you set the ID property of a WizardStepBase control to "Step1", you can reference the child controls of the wizard step in code for that page as Step1.Controls.

The WizardStepBase control ensures that each step in a Wizard control has a valid unique identifier when steps are added or modified at design time. For example, when you set the ID for a step at design time, it cannot match the identifier for another step contained in the Wizard control, and it cannot match the ID for the containing Wizard control.

The following code example defines three wizard steps for a Wizard control in a Web Forms page. In code for the page, the wizard step instances are named by their ID values, and they can be referenced in the code as WizardStep1, WizardStep2, and WizardStep3.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: