HyperLinkDataBindingHandler クラス
アセンブリ: System.Design (system.design.dll 内)


HyperLinkDataBindingHandler クラスから派生する CustomHyperLinkDataBindingHandler という名前のクラスを作成するコードの例を次に示します。このコードは、DataBindControl メソッドを使用して CustomHyperLink クラスのデザイン時データ連結を解決します。
' 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 ' DataBindControl End Class ' CustomHyperLinkDataBindingHandler
// 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

System.Web.UI.Design.DataBindingHandler
System.Web.UI.Design.HyperLinkDataBindingHandler


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- HyperLinkDataBindingHandler クラスのページへのリンク