ControlBuilder.GetChildControlType メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ControlBuilder.GetChildControlType メソッドの意味・解説 

ControlBuilder.GetChildControlType メソッド

タグ対応するコントロールの型を示す Type取得します。このメソッドASP.NET ページ フレームワークによって呼び出されます。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Overridable Function
 GetChildControlType ( _
    tagName As String, _
    attribs As IDictionary _
) As Type
Dim instance As ControlBuilder
Dim tagName As String
Dim attribs As IDictionary
Dim returnValue As Type

returnValue = instance.GetChildControlType(tagName, attribs)
public virtual Type GetChildControlType (
    string tagName,
    IDictionary attribs
)
public:
virtual Type^ GetChildControlType (
    String^ tagName, 
    IDictionary^ attribs
)
public Type GetChildControlType (
    String tagName, 
    IDictionary attribs
)
public function GetChildControlType (
    tagName : String, 
    attribs : IDictionary
) : Type

パラメータ

tagName

子のタグ名。

attribs

コントロール格納されている属性配列

戻り値
指定したコントロールの子Type

解説解説

このメソッドは、解析中に ASP.NET ページ フレームワークによって呼び出されるもので、コードから直接使用するためのものではありません。

使用例使用例
' 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.

<AspNetHostingPermission(SecurityAction.Demand, _
  Level:=AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class
 MyItemControlBuilder
  Inherits ControlBuilder
  
  ' Override the GetChildControlType method to detect
  ' child elements named myitem.
  Public Overrides Function
 GetChildControlType(ByVal tagName As String,
 ByVal attribs As IDictionary) As Type
     If [String].Compare(tagName, "myitem",
 True) = 0 Then
        Return GetType(TextBox)
     End If
     Return Nothing
  End Function 'GetChildControlType
  
  
  ' Override the AppendLiteralString method so that literal
  ' text between rows of controls are ignored.  
  Public Overrides Sub AppendLiteralString(s
 As String)
  End Sub 'AppendLiteralString
End Class 'MyItemControlBuilder
 ' Ignores literals between rows.
// 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.
[AspNetHostingPermission(SecurityAction.Demand, 
   Level=AspNetHostingPermissionLevel.Minimal)]
public sealed class MyItemControlBuilder :
 ControlBuilder 
{
   // Override the GetChildControlType method to detect
   // child elements named myitem.
   public override Type GetChildControlType(String tagName,
                                     IDictionary attributes)
   {
      if (String.Compare(tagName, "myitem", true)
 == 0) 
      {
         return typeof(TextBox);
      }
      return null;
   }

   // Override the AppendLiteralString method so that literal
   // text between rows of controls are ignored.  
   public override void AppendLiteralString(string
 s) 
   {
     // Ignores literals between rows.
   }
}
// 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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ControlBuilder クラス
ControlBuilder メンバ
System.Web.UI 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からControlBuilder.GetChildControlType メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からControlBuilder.GetChildControlType メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からControlBuilder.GetChildControlType メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ControlBuilder.GetChildControlType メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ControlBuilder.GetChildControlType メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS