asp.net.ph

Control.NamingContainer Property

System.Web.UI Namespace   Control Class


Returns a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same Control.ID property value.

Syntax


Script Control.NamingContainer

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

Property Value

The server control's naming container.

Remarks

Each page in an ASP.NET Web application contains a hierarchy of controls. This hierarchy is not dependent on whether a control generates UI visible to the user. The naming container for a given control is the parent control above it in the hierarchy that implements the INamingContainer interface. A server control that implements this interface creates a unique namespace for the ID property values of its child server controls.

Creating a unique namespace for server controls is particularly important when you bind data against list Web server controls, such as the Repeater and DataList server controls. When multiple entries in the data source create multiple instances of a server control that is a child of the repeating control, the naming container ensures that each instance of these child controls have UniqueID property values that do not conflict. The default naming container for a page is the instance of the Page class generated when that page is requested.

You can use this property to determine the naming container where a specific server control is located.

See Also

Control Members   INamingContainer   UniqueID   Control.ID 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