WizardStepBase.ID Property
Assembly: System.Web (in system.web.dll)
public: virtual property String^ ID { String^ get () override; void set (String^ value) override; }
/** @property */ public String get_ID () /** @property */ public void set_ID (String value)
public override function get ID () : String public override function set ID (value : String)
Not applicable.
Property Value
The programmatic identifier assigned to the control.| Exception type | Condition |
|---|---|
| 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.