語言

DataListDesigner.GetErrorDesignTimeHtml(Exception) 方法

定義

當渲染控制項時遇到錯誤時,能讓 HTML 在指定例外設計時顯示。

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

那個例外發生了。

傳回

該 HTML 在設計時會顯示於指定例外的條件下。

範例

以下程式碼範例說明如何在異常發生時覆寫 GetErrorDesignTimeHtml 修改控制項在設計表面外觀 DataList 的方法。

此程式碼範例是本類別更大範例 DataListDesigner 的一部分。

protected override string
    GetErrorDesignTimeHtml(System.Exception exc)
{
    return CreatePlaceHolderDesignTimeHtml(
        "ASPNET.Examples: An error occurred while rendering the GridView.");
}
Protected Overrides Function _
    GetErrorDesignTimeHtml(ByVal exc As Exception) As String

    Return CreatePlaceHolderDesignTimeHtml( _
        "ASPNET.Examples: An error occurred while rendering the GridView.")

End Function

適用於

另請參閱