ControlDesigner.CreatePlaceHolderDesignTimeHtml 方法

定义

提供一个简单的矩形占位符表示形式,该表示形式显示该控件的类型和 ID。

重载

CreatePlaceHolderDesignTimeHtml()

提供一个简单的矩形占位符表示形式,该表示形式显示该控件的类型和 ID。

CreatePlaceHolderDesignTimeHtml(String)

提供一个简单的矩形占位符表示形式,该表示形式显示该控件的类型和 ID 以及指定的附加说明或信息。

CreatePlaceHolderDesignTimeHtml()

提供一个简单的矩形占位符表示形式,该表示形式显示该控件的类型和 ID。

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

返回

String

一个字符串,包含提供有关控件的基本信息的设计时 HTML 标记。

继承者说明

典型的设计模式是尝试通过关联的控件获取 HTML 标记,然后如果遇到错误,请调用 GetErrorDesignTimeHtml(Exception) 该方法。 如果控件未返回任何标记,则调用 GetEmptyDesignTimeHtml() 该方法(如果未重写该方法以提供特定标记),则调用 CreatePlaceHolderDesignTimeHtml() 该方法,该方法应包含有关控件类型和 ID 的信息。

另请参阅

适用于

CreatePlaceHolderDesignTimeHtml(String)

提供一个简单的矩形占位符表示形式,该表示形式显示该控件的类型和 ID 以及指定的附加说明或信息。

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

参数

instruction
String

一个字符串,包含要添加到 HTML 输出的文本和标记。

返回

String

一个字符串,包含提供有关控件的信息的设计时 HTML 标记。

示例

下面的代码示例演示如何重写 GetDesignTimeHtml 模板化控件设计器中的方法。 然后, instruction 在对方法的调用 CreatePlaceHolderDesignTimeHtml 中作为参数传递字符串,该方法提供设计时 HTML 标记。

此代码示例是为该属性提供的大型示例的 TemplateGroups 一部分。

// Add instructions to the placeholder view of the control
public override string GetDesignTimeHtml()
{
    return CreatePlaceHolderDesignTimeHtml("Click here and use " +
        "the task menu to edit the templates.");
}
' Add instructions to the placeholder view of the control
Public Overloads Overrides Function GetDesignTimeHtml() As String
    Return CreatePlaceHolderDesignTimeHtml("Click here and use " & _
        "the task menu to edit the templates.")
End Function

继承者说明

典型的设计模式是尝试通过关联的控件获取 HTML 标记,然后如果遇到错误,请调用 GetErrorDesignTimeHtml(Exception) 该方法。 如果控件未返回任何标记,则调用 GetEmptyDesignTimeHtml() 该方法(如果未重写该方法以提供特定标记),则调用 CreatePlaceHolderDesignTimeHtml() 该方法,该方法应包含有关控件类型和 ID 的信息。

另请参阅

适用于