ParseChildrenAttribute.ChildControlType プロパティ
アセンブリ: System.Web (system.web.dll 内)

コントロールのタイプ。既定値は System.Web.UI.Control です。

可能なコントロールのタイプが null 参照 (Visual Basic では Nothing) の場合、つまり指定されない場合、既定値である System.Web.UI.Control コントロールが返されます。

ChildControlType プロパティを照会する方法を次のコード例に示します。このコード例で使用されている CollectionPropertyControl クラスと Employee クラスの定義については、「ParseChildrenAttribute」を参照してください。
<%@ Page Language="VB" %> <%@ Register TagPrefix="AspSample" Assembly="Samples.AspNet.VB.Controls" Namespace="Samples.AspNet.VB.Controls" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) ' Create a new employee object and add it to custom control. Dim e1 As New Employee("Employee 2", "Title 2", "Alias 2") CollectionPropertyControl1.Employees.Add(e1) ' Verify attribute values. Dim p As ParseChildrenAttribute = _ Attribute.GetCustomAttribute(GetType(CollectionPropertyControl), _ GetType(ParseChildrenAttribute)) Dim sb As New StringBuilder() sb.Append("The ChildControlType property is " & p.ChildControlType.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() End Sub </script> <html > <head id="Head1" runat="server"> <title>PersistChildrenAttribute</title> </head> <body> <form id="Form1" runat="server"> <div> <asp:Label ID="Message" runat="server"/> <AspSample:CollectionPropertyControl id="CollectionPropertyControl1" runat="server"> <Employees> <AspSample:Employee Name="Employee 1" Title="Title 1" Alias="Alias 1" /> </Employees> </AspSample:CollectionPropertyControl> </div> </form> </body> </html>
<%@ Page Language="C#" %> <%@ Register TagPrefix="AspSample" Assembly="Samples.AspNet.CS.Controls" Namespace="Samples.AspNet.CS.Controls" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { // Create a new employee object and add it to the custom control. Employee e1 = new Employee("Employee 2", "Title 2", "Alias 2"); CollectionPropertyControl1.Employees.Add(e1); // Verify attribute values. ParseChildrenAttribute p = (ParseChildrenAttribute)Attribute.GetCustomAttribute(typeof(CollectionPropertyControl) , typeof(ParseChildrenAttribute)); StringBuilder sb = new StringBuilder(); sb.Append("The ChildControlType property is " + p.ChildControlType.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(); } </script> <html > <head runat="server"> <title>ParseChildrenAttribute Example</title> </head> <body> <form runat="server"> <div> <asp:Label ID="Message" runat="server"/> <AspSample:CollectionPropertyControl id="CollectionPropertyControl1" runat="server"> <Employees> <AspSample:Employee Name="Employee 1" Title="Title 1" Alias="Alias 1" /> </Employees> </AspSample:CollectionPropertyControl> </div> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からParseChildrenAttribute.ChildControlType プロパティを検索する場合は、下記のリンクをクリックしてください。

- ParseChildrenAttribute.ChildControlType プロパティのページへのリンク