HyperLinkDataBindingHandler Clase

Definición

Proporciona un controlador de enlace de datos para una propiedad de hipervínculo.

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
Herencia
HyperLinkDataBindingHandler

Ejemplos

En el ejemplo de código siguiente se crea una clase denominada CustomHyperLinkDataBindingHandler, que se deriva de la HyperLinkDataBindingHandler clase . Resuelve el enlace de datos en tiempo de diseño para la CustomHyperLink clase mediante el DataBindControl método .

// 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

Constructores

HyperLinkDataBindingHandler()

Inicializa una instancia de la clase HyperLinkDataBindingHandler.

Métodos

DataBindControl(IDesignerHost, Control)

Resuelve el enlace de datos en tiempo de diseño para el control especificado.

Equals(Object)

Determina si el objeto especificado es igual que el objeto actual.

(Heredado de Object)
GetHashCode()

Sirve como la función hash predeterminada.

(Heredado de Object)
GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)

Se aplica a