HtmlSelectBuilder.GetChildControlType(String, IDictionary) Método

Definição

Obtém o Type para os controles filho do controle HtmlSelect.

C#
public override Type GetChildControlType (string tagName, System.Collections.IDictionary attribs);

Parâmetros

tagName
String

O nome da marca do controle filho.

attribs
IDictionary

Uma matriz de atributos contidos no controle filho.

Retornos

Type

O Type do controle filho especificado do controle HtmlSelect.

Exemplos

O exemplo de código a seguir demonstra como substituir o GetChildControlType método para verificar se há tipos de controle filho personalizados. Para obter um exemplo de código de trabalho completo, consulte o tópico de visão geral da HtmlSelectBuilder classe.

C#
[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;
}

Comentários

Use o GetChildControlType método para retornar o Type controle filho especificado em um HtmlSelect controle.

Aplica-se a

Produto Versões
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

Confira também