Udostępnij za pośrednictwem


LoginDesigner.GetErrorDesignTimeHtml(Exception) Metoda

Definicja

Zawiera znaczniki używane do renderowania skojarzonej kontrolki w czasie projektowania, gdy wystąpił błąd.

protected:
 override System::String ^ GetErrorDesignTimeHtml(Exception ^ e);
protected override string GetErrorDesignTimeHtml (Exception e);
override this.GetErrorDesignTimeHtml : Exception -> string
Protected Overrides Function GetErrorDesignTimeHtml (e As Exception) As String

Parametry

e
Exception

To Exception zostało rzucone.

Zwraca

String

Ciąg zawierający znaczniki używane do renderowania skojarzonego Login w czasie projektowania po wystąpieniu błędu.

Przykłady

Poniższy przykład kodu pokazuje, jak zastąpić metodę GetErrorDesignTimeHtml w klasie dziedziczonej z LoginDesigner klasy w celu zmiany wyglądu kontrolki pochodzącej z kontrolki Login w czasie projektowania. Przykład generuje znaczniki dla symbolu zastępczego zawierającego komunikat o błędzie renderowany w czerwonym, pogrubionym tekście.

// Generate the design-time markup for the control when an error occurs.
protected override string GetErrorDesignTimeHtml(Exception e) 
{
    // Write the error message text in red, bold.
    string errorRendering =
        "<span style=\"font-weight:bold; color:Red; \">" +
        e.Message + "</span>";

    return CreatePlaceHolderDesignTimeHtml(errorRendering);
} // GetErrorDesignTimeHtml
' Generate the design-time markup for the control when an error occurs.
Protected Overrides Function GetErrorDesignTimeHtml( _
    ByVal ex As Exception) As String

    ' Write the error message text in red, bold.
    Dim errorRendering As String = _
        "<span style=""font-weight:bold; color:Red; "">" & _
        ex.Message & "</span>"

    Return CreatePlaceHolderDesignTimeHtml(errorRendering)

End Function ' GetErrorDesignTimeHtml

Uwagi

Symbol zastępczy renderowany przez kontrolkę czasu Login projektowania zawiera nazwę typu, nazwę kontrolki i komunikaty ogłaszające i opisujące błąd.

Dotyczy

Zobacz też