asp.net.ph

Control.UniqueID Property

System.Web.UI Namespace   Control Class


Returns the unique, hierarchically-qualified identifier for a control.

Syntax


Script Control.UniqueID

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value

The fully-qualified identifier for a control.

Remarks

This identifier is generated automatically when a page request is processed.

This property differs from the ID property, in that its value includes the identifier for the server control's naming container.

UniqueID is particularly important in differentiating server controls contained within a data-bound list control, such as the Repeater, DataList, and DataGrid controls.

These controls serve as the naming container for their child controls, creating a unique namespace so that the ID property values of the child controls do not conflict.

For example, consider a case where you include a Label control in a Repeater control, and you assign the Label control an ID of myLabel, and the Repeater an ID of myRepeater.

If you bind the Repeater to a data source with three entries, the resulting UniqueID properties for each instance of the Label controls would be myRepeater:ctl0:myLabel, myRepeater:Ctl1:myLabel, and myRepeater:Ctl2:myLabel.

See Also

Control Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph