HyperLinkDataBindingHandler クラス

定義

ハイパーリンク プロパティのデータ連結ハンドラーを提供します。

public ref class HyperLinkDataBindingHandler : System::Web::UI::Design::DataBindingHandler
public class HyperLinkDataBindingHandler : System.Web.UI.Design.DataBindingHandler
type HyperLinkDataBindingHandler = class
    inherit DataBindingHandler
Public Class HyperLinkDataBindingHandler
Inherits DataBindingHandler
継承
HyperLinkDataBindingHandler

次のコード例では、クラスから派生する 、という名前 CustomHyperLinkDataBindingHandlerのクラスを HyperLinkDataBindingHandler 作成します。 このメソッドを使用して、クラスの CustomHyperLink デザイン時データ バインディングを DataBindControl 解決します。

// Derive a class from the HyperLinkDataBindingHandler. It will 
// resolve  data binding for the CustomHyperlink at design time.
public class CustomHyperLinkDataBindingHandler : 
    HyperLinkDataBindingHandler
{
    // Override the DataBindControl to set property values in  
    // the DataBindingCollection at design time.
    public override void DataBindControl(IDesignerHost designerHost, 
        Control control)
    {
        DataBindingCollection bindings = 
            ((IDataBindingsAccessor)control).DataBindings;
        DataBinding imageBinding = bindings["ImageUrl"];

           // If Text is empty, supply a default value.
        if (!(imageBinding == null))
        {
            CustomHyperLink hype = (CustomHyperLink)control;
            hype.ImageUrl = "Image URL.";
        }

        // Call the base method to bind the control.
        base.DataBindControl(designerHost, control);
    } // DataBindControl
} // CustomHyperLinkDataBindingHandler
' Derive a class from the HyperLinkDataBindingHandler. It will 
' resolve  data binding for the CustomHyperlink at design time.
Public Class CustomHyperLinkDataBindingHandler
    Inherits HyperLinkDataBindingHandler

    ' Override the DataBindControl to set property values in  
    ' the DataBindingCollection at design time.
    Public Overrides Sub DataBindControl( _
        ByVal designerHost As IDesignerHost, ByVal control As Control)

        Dim bindings As DataBindingCollection = _
            CType(control, IDataBindingsAccessor).DataBindings
        Dim imageBinding As DataBinding = bindings("ImageUrl")

        If Not (imageBinding Is Nothing) Then
            Dim hLink As CustomHyperLink = CType(control, CustomHyperLink)
            hLink.ImageUrl = "Image URL."
        End If

        MyBase.DataBindControl(designerHost, control)
    End Sub
End Class

コンストラクター

HyperLinkDataBindingHandler()

HyperLinkDataBindingHandler クラスのインスタンスを初期化します。

メソッド

DataBindControl(IDesignerHost, Control)

指定したコントロールのデザイン時のデータ バインディングを解決します。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象