HiddenFieldDesigner.GetDesignTimeHtml Metoda

Definicja

Pobiera znaczniki używane do renderowania skojarzonej kontrolki w czasie projektowania.

public:
 override System::String ^ GetDesignTimeHtml();
public override string GetDesignTimeHtml ();
override this.GetDesignTimeHtml : unit -> string
Public Overrides Function GetDesignTimeHtml () As String

Zwraca

String

Ciąg zawierający znaczniki używane do renderowania HiddenField w czasie projektowania.

Przykłady

Poniższy przykład kodu pokazuje, jak zastąpić metodę GetDesignTimeHtml w klasie dziedziczonej z HiddenFieldDesigner klasy w celu zmiany wyglądu HiddenField kontrolki w czasie projektowania. Zastąpienie GetDesignTimeHtml generuje symbol zastępczy, który zawiera Value właściwość w symbolu zastępczym wraz z nazwą klasy kontrolki i właściwością ID .

// Generate the design-time markup.
public override string GetDesignTimeHtml()
{
    // Get a reference to the control or a copy of the control.
    MyHiddenField myHF = (MyHiddenField)ViewControl;

    // Create a placeholder that displays the control value.
    string markup = CreatePlaceHolderDesignTimeHtml(
         "Value: \"" + myHF.Value.ToString() + "\"" );

    return markup;
} // GetDesignTimeHtml
' Generate the design-time markup.
Public Overrides Function GetDesignTimeHtml() As String

    ' Get a reference to the control or a copy of the control.
    Dim myHF As MyHiddenField = CType(ViewControl, MyHiddenField)

    Dim markup As String = _
        CreatePlaceHolderDesignTimeHtml( _
            "Value: """ & myHF.Value.ToString() & """" )

    Return markup

End Function ' GetDesignTimeHtml

Uwagi

Metoda GetDesignTimeHtml generuje znaczniki dla symbolu zastępczego, który zawiera nazwę klasy sterującej ID i właściwość .

Dotyczy

Zobacz też