ControlDesigner.CreateErrorDesignTimeHtml 方法

定義

建立 HTML 標記,以在設計階段顯示錯誤訊息。

多載

CreateErrorDesignTimeHtml(String)

建立 HTML 標記,以在設計階段顯示指定的錯誤訊息。

CreateErrorDesignTimeHtml(String, Exception)

建立 HTML 標記,以在設計階段顯示指定的例外狀況錯誤訊息。

CreateErrorDesignTimeHtml(String)

建立 HTML 標記,以在設計階段顯示指定的錯誤訊息。

protected:
 System::String ^ CreateErrorDesignTimeHtml(System::String ^ errorMessage);
protected string CreateErrorDesignTimeHtml (string errorMessage);
member this.CreateErrorDesignTimeHtml : string -> string
Protected Function CreateErrorDesignTimeHtml (errorMessage As String) As String

參數

errorMessage
String

要在產生之 HTML 標記中包含的錯誤訊息。

傳回

HTML 標記字串,包含指定的錯誤訊息。

備註

CreateErrorDesignTimeHtml使用 方法來建立 HTML 標籤,在設計階段顯示控制項的錯誤訊息。 的值 errorMessage 會指定在設計階段向控制項使用者顯示的當地語系化字串。

方法 ControlDesignerCreateErrorDesignTimeHtml 類別實作會傳回具有兩個數據列的資料表,如下所示:

  • 第一個資料列包含 物件屬性的類型 ControlDesigner 名稱和網站名稱 Component

  • 第二個數據列包含輸入錯誤訊息字串。

若要針對具有相關聯例外狀況的錯誤訊息產生 HTML 標籤,請使用 多 CreateErrorDesignTimeHtml(String, Exception) 載。 若要產生例外狀況的 HTML 標籤,而不指定當地語系化的錯誤訊息,請使用 GetErrorDesignTimeHtml 方法。

給繼承者的注意事項

CreateErrorDesignTimeHtml(String) 載的功能相當於呼叫 方法, CreateErrorDesignTimeHtml(String, Exception) 並將 e 設定為 null

另請參閱

適用於

CreateErrorDesignTimeHtml(String, Exception)

建立 HTML 標記,以在設計階段顯示指定的例外狀況錯誤訊息。

protected:
 System::String ^ CreateErrorDesignTimeHtml(System::String ^ errorMessage, Exception ^ e);
protected string CreateErrorDesignTimeHtml (string errorMessage, Exception e);
member this.CreateErrorDesignTimeHtml : string * Exception -> string
Protected Function CreateErrorDesignTimeHtml (errorMessage As String, e As Exception) As String

參數

errorMessage
String

錯誤訊息會包含於所產生的 HTML 字串中。

e
Exception

例外狀況包含於所產生的 HTML 字串中。

傳回

HTML 標記,包含指定的 errorMessagee

備註

CreateErrorDesignTimeHtml使用 方法提供簡單的 HTML 標籤,可用來在設計階段顯示控制項的錯誤和例外狀況詳細資料。 的值 errorMessage 會指定在設計階段向控制項使用者顯示的當地語系化字串。

方法 ControlDesignerCreateErrorDesignTimeHtml 類別實作會傳回具有兩個數據列的資料表,如下所示:

  • 第一個資料列包含 物件屬性的類型 ControlDesigner 名稱和網站名稱 Component

  • 第二個數據列包含輸入錯誤訊息和 Message 例外狀況的字串。

若要產生錯誤訊息的 HTML 標籤而不指定例外狀況,請使用 多 CreateErrorDesignTimeHtml(String) 載。 若要產生例外狀況的 HTML 標籤,而不指定當地語系化的錯誤訊息,請使用 GetErrorDesignTimeHtml 方法。

給繼承者的注意事項

CreateErrorDesignTimeHtml(String, Exception)發生例外狀況時,應該從 GetViewRenderingGetErrorDesignTimeHtml(Exception) 方法呼叫 方法。

另請參閱

適用於