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 指定在设计时向控件的用户显示的本地化字符串。

ControlDesigner方法的CreateErrorDesignTimeHtml类实现返回包含两行的表,如下所示:

  • 第一行包含 对象的 属性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 字符串中的异常。

返回

包含指定的 errorMessagee 的 HTML 标记。

注解

CreateErrorDesignTimeHtml使用 方法提供简单的 HTML 标记,可用于在设计时显示控件的错误和异常详细信息。 的值 errorMessage 指定在设计时向控件的用户显示的本地化字符串。

ControlDesigner方法的CreateErrorDesignTimeHtml类实现返回包含两行的表,如下所示:

  • 第一行包含 对象的 属性ControlDesigner的类型名称和站点名称Component

  • 第二行包含输入错误消息和 Message 异常的字符串。

若要在不指定异常的情况下为错误消息生成 HTML 标记,请使用 CreateErrorDesignTimeHtml(String) 重载。 若要在不指定本地化错误消息的情况下为异常生成 HTML 标记,请使用 GetErrorDesignTimeHtml 方法。

继承者说明

CreateErrorDesignTimeHtml(String, Exception)发生异常时,应从 GetViewRenderingGetErrorDesignTimeHtml(Exception) 方法调用 方法。

另请参阅

适用于