DataBindingHandlerAttribute クラスとは? わかりやすく解説

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

DataBindingHandlerAttribute クラス

デザイナ内でコントロールデータ連結実行するデザインクラス指定します。このクラス継承できません。

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

<AttributeUsageAttribute(AttributeTargets.Class)> _
Public NotInheritable Class
 DataBindingHandlerAttribute
    Inherits Attribute
Dim instance As DataBindingHandlerAttribute
[AttributeUsageAttribute(AttributeTargets.Class)] 
public sealed class DataBindingHandlerAttribute
 : Attribute
[AttributeUsageAttribute(AttributeTargets::Class)] 
public ref class DataBindingHandlerAttribute
 sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class) */ 
public final class DataBindingHandlerAttribute
 extends Attribute
AttributeUsageAttribute(AttributeTargets.Class) 
public final class DataBindingHandlerAttribute
 extends Attribute
解説解説
使用例使用例

編集モード時にデザイナ使用するMyDataBindingHandler という名前のデータ バインディング ハンドラ定義するコード例次に示します編集モード終了時に、Text プロパティ値が表示されます。

Namespace CustomControls

  <DataBindingHandler(GetType(MyDataBindingHandler)), ToolboxData("<{0}:MyLabel
 runat=server></{0}:MyLabel>")>  _
    Public Class MyLabel
      Inherits Label
      
      Public Sub New()
        'Insert your code here.
      End Sub 'New
      
    End Class 'MyLabel
   
    Public Class MyDataBindingHandler
      Inherits DataBindingHandler
      
      Public Overrides Sub
 DataBindControl(host As IDesignerHost, control As
 Control)
         CType(control, Label).Text = "Added by data binding handler."
      End Sub 'DataBindControl
      
    End Class 'MyDataBindingHandler
    
End Namespace 'CustomControls
 

using System;
using System.Collections;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.ComponentModel.Design;


namespace CustomControls
{
  [
    DataBindingHandler(typeof(MyDataBindingHandler)),
    ToolboxData("<{0}:MyLabel runat=server></{0}:MyLabel>")
  ]
  public class MyLabel : Label 
  {
    public  MyLabel()
    { 
      // Insert your code here.
    } 
  }

  public class MyDataBindingHandler : DataBindingHandler
  {
    public override void DataBindControl(IDesignerHost
 host, Control control)
    {
      ((Label)control).Text = "Added by data binding handler.";
    }
  }

}

package CustomControls;

import System.*;
import System.Collections.*;
import System.Web.UI.*;
import System.Web.UI.Design.*;
import System.Web.UI.WebControls.*;
import System.ComponentModel.*;
import System.ComponentModel.Design.*;

/** @attribute DataBindingHandler(MyDataBindingHandler.class)
    @attribute ToolboxData("<{0}:MyLabel runat=server></{0}:MyLabel>")
 */

public class MyLabel extends Label
{
    public MyLabel()
    {
        // Insert your code here.
    } //MyLabel
} //MyLabel

public class MyDataBindingHandler extends DataBindingHandler
{
    public void DataBindControl(IDesignerHost
 host, Control control)
    {
        ((Label)control).set_Text("Added by data binding handler.");
    } //DataBindControl
} //MyDataBindingHandler
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Attribute
    System.Web.UI.DataBindingHandlerAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataBindingHandlerAttribute メンバ
System.Web.UI 名前空間
Attribute



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

辞書ショートカット

すべての辞書の索引

「DataBindingHandlerAttribute クラス」の関連用語

DataBindingHandlerAttribute クラスのお隣キーワード
検索ランキング

   

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



DataBindingHandlerAttribute クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS