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

适用于

另请参阅