LoginViewDesigner.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

返品

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

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

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

注釈

エラーデザイン時 LoginView コントロールは、型名、コントロール名、およびエラーを発表して説明するメッセージを含むパネルとしてレンダリングされます。

適用対象

こちらもご覧ください