HtmlSelectBuilder.GetChildControlType(String, IDictionary) 메서드

정의

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

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 .

적용 대상

추가 정보