This documentation is archived and is not being maintained.

ParseChildrenAttribute.DefaultProperty Property

Gets or sets the default property for the server control into which the elements are parsed.

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

public string DefaultProperty { get; set; }

Property Value

Type: System.String
The name of the default collection property of the server control into which the elements are parsed.


The current ParseChildrenAttribute was invoked with childrenAsProperties set to false.

The DefaultProperty property is used only if a string is passed to the ParseChildrenAttribute constructor. When the ParseChildrenAttribute class is created, the DefaultProperty property defines the default property for the server control that is being parsed.

The following code example demonstrates how to query the DefaultProperty property. For definitions of the CollectionPropertyControl and Employee classes that are used in this code example, see ParseChildrenAttribute.

<%@ Page Language="C#" Debug="true" %>
<%@ Register TagPrefix="AspSample" Assembly="Samples.AspNet.CS.Controls" Namespace="Samples.AspNet.CS.Controls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<script runat="server">

  protected void Page_Load(object sender, EventArgs e)

    // Verify attribute values.
    ParseChildrenAttribute p = 

    StringBuilder sb = new StringBuilder();
    sb.Append("The DefaultProperty property is " + p.DefaultProperty.ToString() + "<br />");
    sb.Append("The ChildrenAsProperties property is " + p.ChildrenAsProperties.ToString() + "<br />");
    sb.Append("The IsDefaultAttribute method returns " + p.IsDefaultAttribute().ToString());
    Message.Text = sb.ToString();


<html xmlns="" >
<head runat="server">
    <title>ParseChildrenAttribute Example</title>
    <form id="form1" runat="server">
      <asp:Label ID="Message"
      <AspSample:CollectionPropertyControl id="CollectionPropertyControl1" 
        <AspSample:Employee Name="Employee 1" 
                            Title="Title 1" 
                            Alias="Alias 1" />
        <AspSample:Employee Name="Employee 2" 
                            Title="Title 2" 
                            Alias="Alias 2" />

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.