HyperLinkDataBindingHandler Klasa

Definicja

Udostępnia procedurę obsługi powiązań danych dla właściwości hiperłącza.

C#
public class HyperLinkDataBindingHandler : System.Web.UI.Design.DataBindingHandler
Dziedziczenie
HyperLinkDataBindingHandler

Przykłady

Poniższy przykład kodu tworzy klasę o nazwie CustomHyperLinkDataBindingHandler, która pochodzi z HyperLinkDataBindingHandler klasy . Rozwiązuje powiązanie danych w czasie projektowania dla CustomHyperLink klasy przy użyciu DataBindControl metody .

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

Konstruktory

HyperLinkDataBindingHandler()

Inicjuje wystąpienie klasy HyperLinkDataBindingHandler.

Metody

DataBindControl(IDesignerHost, Control)

Rozwiązuje powiązanie danych w czasie projektowania dla określonej kontrolki.

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy

Produkt Wersje
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8