HtmlSelectBuilder.GetChildControlType(String, IDictionary) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
컨트롤의 Type 자식 컨트롤에 HtmlSelect 대한 값을 가져옵니다.
public:
override Type ^ GetChildControlType(System::String ^ tagName, System::Collections::IDictionary ^ attribs);
public override Type GetChildControlType(string tagName, System.Collections.IDictionary attribs);
override this.GetChildControlType : string * System.Collections.IDictionary -> Type
Public Overrides Function GetChildControlType (tagName As String, attribs As IDictionary) As Type
매개 변수
- tagName
- String
자식 컨트롤의 태그 이름입니다.
- attribs
- IDictionary
자식 컨트롤에 포함된 특성 배열입니다.
반품
Type 컨트롤의 HtmlSelect 지정된 자식 컨트롤입니다.
예제
다음 코드 예제에서는 사용자 지정 자식 컨트롤 형식을 확인 하는 메서드를 재정의 GetChildControlType 하는 방법을 보여 줍니다. 전체 작업 코드 예제는 클래스 개요 항목을 참조 HtmlSelectBuilder 하세요.
[AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
public override Type GetChildControlType(string tagName, IDictionary attribs)
{
// Distinguish between two possible types of child controls.
if (tagName.ToLower().EndsWith("myoption1"))
{
return typeof(MyOption1);
}
else if (tagName.ToLower().EndsWith("myoption2"))
{
return typeof(MyOption2);
}
return null;
}
<AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Overrides Function GetChildControlType(ByVal tagName As String, ByVal attribs As IDictionary) As Type
' Distinguish between two possible types of child controls.
If tagName.ToLower().EndsWith("myoption1") Then
Return GetType(MyOption1)
ElseIf tagName.ToLower().EndsWith("myoption2") Then
Return GetType(MyOption2)
End If
Return Nothing
End Function
설명
메서드를 GetChildControlType 사용하여 컨트롤에서 Type 지정된 자식 컨트롤 HtmlSelect 을 반환합니다.