Gets or sets the programmatic identifier assigned to the server control.
Assembly: System.Web (in System.Web.dll)
Setting this property on a server control provides you with programmatic access to the server control's properties, events, and methods. This property can be set by Web developers by declaring an attribute in the opening tag of an ASP.NET server control.
If this property is not specified for a server control, either declaratively or programmatically, you can obtain a reference to the control through its parent control's Controls property.
Only combinations of alphanumeric characters and the underscore character ( _ ) are valid values for this property. Including spaces or other invalid characters will cause an ASP.NET page parser error.
Sub Page_Init(sender As Object, e As EventArgs) ' Add a event Handler for 'Init'. AddHandler myControl.Init, AddressOf Control_Init End Sub Sub Control_Init(sender As Object, e As EventArgs) Response.Write(("The ID of the object initially : " + myControl.ID)) ' Change the ID property. myControl.ID = "TestControl" Response.Write(("<br />The changed ID : " + myControl.ID)) End Sub
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