ControlBuilder.GetChildControlType Method

Obtains the Type of the control type corresponding to a child tag. This method is called by the ASP.NET page framework.

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

public:
virtual Type^ GetChildControlType (
	String^ tagName, 
	IDictionary^ attribs
)
public Type GetChildControlType (
	String tagName, 
	IDictionary attribs
)
public function GetChildControlType (
	tagName : String, 
	attribs : IDictionary
) : Type
Not applicable.

Parameters

tagName

The tag name of the child.

attribs

An array of attributes contained in the child control.

Return Value

The Type of the specified control's child.

This method is called by the ASP.NET page framework during parsing and is not intended to be called directly in you code.

No code example is currently available or this language may not be supported.
// Create a custom ControlBuilder that interprets nested elements
// named myitem as TextBoxes. If this class is called in a 
// ControlBuilderAttribute applied to a custom control, when
// that control is created in a page and it contains child elements
// that are named myitem, the child elements will be rendered as 
// TextBox server controls. This control builder also ignores literal
// strings between elements when it is associated with a control.

public class MyItemControlBuilder extends ControlBuilder
{
    // Override the GetChildControlType method to detect
    // child elements named myitem.
    public Type GetChildControlType(String tagName, IDictionary attributes)
    {
        if (String.Compare(tagName, "myitem", true) == 0) {
            return TextBox.class.ToType();
        }
        return null;
    } //GetChildControlType

    // Override the AppendLiteralString method so that literal
    // text between rows of controls are ignored.  
    public void AppendLiteralString(String s)
    {
        // Ignores literals between rows.
    } //AppendLiteralString
} //MyItemControlBuilder

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: