LoginDesigner.GetErrorDesignTimeHtml(Exception) メソッド

定義

エラーが発生したときに、関連付けられたコントロールをデザイン時にレンダリングするために使用されるマークアップを提供します。

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

パラメーター

e
Exception

スローされた Exception

返品

エラーが発生した後、関連付けられた Login をデザイン時にレンダリングするために使用されるマークアップを含む文字列。

次のコード例では、GetErrorDesignTimeHtml クラスから継承されたクラスのLoginDesigner メソッドをオーバーライドして、デザイン時にLogin コントロールから派生したコントロールの外観を変更する方法を示します。 この例では、赤い太字のテキストでレンダリングされたエラー メッセージを含むプレースホルダーのマークアップを生成します。

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

注釈

デザイン時 Login コントロールがレンダリングするプレースホルダーには、型名、コントロール名、およびエラーを発表して説明するメッセージが含まれています。

適用対象

こちらもご覧ください