Latest web development tutorials

ASP.NET ID attribute

Control Standard Properties Reference Control Standard Properties Reference

Definition and Usage

ID Property Gets or sets the programmatic identifier assigned to the control.

Under normal circumstances would set this property, use this property when the control script interaction with other controls or current. Setting this property controls on the property provides programmatic access to the controls, events, and methods. Web developers can set this property by declaring the start tag ASP.NET control's ID attribute. If you do not specify the properties for the control (declaratively or programmatically), you can get a reference to the control by the Controls property of the parent control.

grammar

<asp:webcontrolid="id" runat="server" />


Examples

The following example shows a Button control set ID attribute:

<form runat="server">
<asp:Button id="button" text="Submit" runat="server" />
</form>

The demonstration >>

Control Standard Properties Reference Control Standard Properties Reference