Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

INamingContainer Interface

 

Identifies a container control that creates a new ID namespace within a Page object's control hierarchy. This is a marker interface only.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public interface class INamingContainer

Any control that implements this interface creates a new namespace in which all child control ID attributes are guaranteed to be unique within an entire application. The marker provided by this interface allows unique naming of the dynamically generated server control instances within the Web server controls that support data binding. These controls include the Repeater, DataGrid, DataList, CheckBoxList, ChangePassword, LoginView, Menu, SiteMapNodeItem, and RadioButtonList controls.

When you develop templated controls, you should implement this interface to avoid naming conflicts on a page. For more information, see ASP.NET Control Designers Overview.

The following code example demonstrates a templated custom server control that implements the INamingContainer interface. When this custom server control is used in an .aspx file, it will provide a unique namespace for any server controls that it contains.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft