INamingContainer 인터페이스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
개체의 컨트롤 계층 내에 새 ID 네임스페이스를 만드는 컨테이너 컨트롤을 Page 식별합니다. 표식 인터페이스에만 해당합니다.
public interface class INamingContainer
public interface INamingContainer
type INamingContainer = interface
Public Interface INamingContainer
- 파생
예제
다음 코드 예제에서는 인터페이스를 구현 하는 템플릿 사용자 지정 서버 컨트롤을 INamingContainer 보여 줍니다. 이 사용자 지정 서버 컨트롤이 .aspx 파일에서 사용되는 경우 포함된 모든 서버 컨트롤에 고유한 네임스페이스를 제공합니다.
using System;
using System.Collections;
using System.Web;
using System.Web.UI;
namespace TemplateControlSamples {
public class RepeaterItem : Control, INamingContainer {
private int itemIndex;
private object dataItem;
public RepeaterItem(int itemIndex, object dataItem) {
this.itemIndex = itemIndex;
this.dataItem = dataItem;
}
public object DataItem {
get {
return dataItem;
}
}
public int ItemIndex {
get {
return itemIndex;
}
}
}
}
Imports System.Collections
Imports System.Web
Imports System.Web.UI
Namespace TemplateControlSamplesVB
Public Class RepeaterItemVB : Inherits Control : Implements INamingContainer
Private _ItemIndex As Integer
Private _DataItem As Object
Public Sub New(ItemIndex As Integer, DataItem As Object)
MyBase.New()
_ItemIndex = ItemIndex
_DataItem = DataItem
End Sub
Public ReadOnly Property DataItem As Object
Get
return _DataItem
End Get
End Property
Public ReadOnly Property ItemIndex As Integer
Get
return _ItemIndex
End Get
End Property
End Class
End Namespace
설명
이 인터페이스를 구현하는 모든 컨트롤은 모든 자식 컨트롤 ID 특성이 전체 애플리케이션 내에서 고유하도록 보장되는 새 네임스페이스를 만듭니다. 이 인터페이스에서 제공하는 표식을 사용하면 데이터 바인딩을 지원하는 웹 서버 컨트롤 내에서 동적으로 생성된 서버 컨트롤 인스턴스의 고유한 이름을 지정할 수 있습니다. 이러한 컨트롤에는 , ,RepeaterDataGrid, DataList, CheckBoxListChangePassword, LoginViewMenu및 SiteMapNodeItem 컨트롤이 포함RadioButtonList됩니다.
템플릿 컨트롤을 개발할 때 페이지에서 명명 충돌을 방지하려면 이 인터페이스를 구현해야 합니다. 자세한 내용은 ASP.NET 컨트롤 디자이너 개요 참조하세요.
확장명 메서드
| Name | Description |
|---|---|
| EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>) |
지정된 데이터 컨트롤에 대해 동적 데이터 동작을 사용하도록 설정합니다. |
| EnableDynamicData(INamingContainer, Type, Object) |
지정된 데이터 컨트롤에 대해 동적 데이터 동작을 사용하도록 설정합니다. |
| EnableDynamicData(INamingContainer, Type) |
지정된 데이터 컨트롤에 대해 동적 데이터 동작을 사용하도록 설정합니다. |
| GetDefaultValues(INamingContainer) |
지정된 데이터 컨트롤의 기본값 컬렉션을 가져옵니다. |
| GetMetaTable(INamingContainer) |
지정된 데이터 컨트롤에 대한 테이블 메타데이터를 가져옵니다. |
| SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>) |
지정된 데이터 컨트롤에 대한 테이블 메타데이터 및 기본값 매핑을 설정합니다. |
| SetMetaTable(INamingContainer, MetaTable, Object) |
지정된 데이터 컨트롤에 대한 테이블 메타데이터 및 기본값 매핑을 설정합니다. |
| SetMetaTable(INamingContainer, MetaTable) |
지정된 데이터 컨트롤에 대한 테이블 메타데이터를 설정합니다. |
| TryGetMetaTable(INamingContainer, MetaTable) |
테이블 메타데이터를 사용할 수 있는지 여부를 결정합니다. |